Overview
The MeasurementConsumer setup process involves two main phases:- Obtaining a creation token - Kingdom operator generates a token
- Creating the MeasurementConsumer - Use the token to register
Prerequisites
Before creating a MeasurementConsumer, you need:Account Credentials
Valid account credentials for authentication with the API
Kingdom Operator Contact
Access to request a creation token from the Kingdom operator
Certificate
An X.509 certificate for signing measurements (can be created after registration)
API Access
Network connectivity to the Cross-Media Measurement API endpoints
Phase 1: Obtaining a Creation Token
The Kingdom operator must generate a MeasurementConsumer creation token for you.Request registration
Contact the Kingdom operator and request registration of a new MeasurementConsumer.Provide the following information:
- Your organization name
- Contact information
- Use case description
- Any compliance requirements
Kingdom operator creates token
The Kingdom operator calls the Kingdom internal API to create a new MeasurementConsumer creation token.
Token generation and storage
The internal API server:
- Generates a new, cryptographically random MC creation token
- Computes a secure hash of the token
- Persists the hash in the database (not the token itself)
- Returns the plaintext token to the Kingdom operator
Phase 2: Creating the MeasurementConsumer
Once you have the creation token and account credentials, you can create your MeasurementConsumer.Authenticate with your account
First, authenticate using your account credentials to obtain an ID token.See the Authentication guide for detailed instructions.
Call the CreateMeasurementConsumer API
Call the public API to create your MeasurementConsumer, passing the creation token.
Token validation
The public API server:
- Hashes the provided creation token
- Calls the internal API with the token hash
- Reads the existing token hash from the database
- Verifies that the hashes match
- Checks that the token hasn’t already been used
MeasurementConsumer creation
If validation succeeds:
- The internal API persists the new MeasurementConsumer in the database
- The token is marked as used (cannot be reused)
- The MeasurementConsumer resource is returned
Post-Setup Configuration
After creating your MeasurementConsumer, complete these additional setup steps:Create and Upload Certificates
Create and Upload Certificates
Generate X.509 certificates for signing measurements:See the Certificates guide for more details.
- Generate a private key and certificate signing request (CSR)
- Obtain a signed certificate from your Certificate Authority
- Upload the certificate to the API
Configure API Keys
Configure API Keys
Set up API keys for programmatic access:
- Generate API keys through your account dashboard
- Store keys securely in your application
- Use keys in API request headers
Establish DataProvider Relationships
Establish DataProvider Relationships
Connect with DataProviders:
- Identify DataProviders you want to work with
- Exchange certificates out-of-band for mutual verification
- Coordinate on measurement protocols and privacy parameters
- Test with sample measurements before production use
Verification
Verify your MeasurementConsumer setup by retrieving your resource:Troubleshooting
PERMISSION_DENIED: Invalid token
PERMISSION_DENIED: Invalid token
Causes:
- The creation token is incorrect
- The token has already been used
- The token has expired
UNAUTHENTICATED error
UNAUTHENTICATED error
Causes:
- ID token is missing or invalid
- ID token has expired
- Authentication failed
Account not found
Account not found
Causes:
- Account credentials haven’t been properly set up
- Using wrong API endpoint
Next Steps
Creating Measurements
Learn how to create your first measurement
Certificates
Set up certificates for digital signatures
Requisitions
Understand how requisitions work
API Reference
Explore the complete API reference
