Overview
This quickstart guide will walk you through making your first API call to the Cross-Media Measurement API. By the end of this guide, you’ll have authenticated with the API and created your first measurement request.This guide assumes you have access to the Cross-Media Measurement system. Contact your Kingdom operator if you need access credentials.
Prerequisites
Before you begin, ensure you have:Development Environment
- A programming language with gRPC support (Python, Java, Go, or C++)
- Protocol Buffer compiler (
protoc) - Basic understanding of gRPC and Protocol Buffers
API Access
- Account credentials for the Kingdom
- A MeasurementConsumer creation token (obtained from Kingdom operator)
- Access to the API endpoint URL
Step 1: Set Up Your Environment
First, clone the API repository to get the Protocol Buffer definitions:Generate Client Code
Use the Protocol Buffer compiler to generate client code for your preferred language:Step 2: Authenticate
The API uses OpenID Connect for authentication. Follow these steps to obtain an ID token:Complete OpenID Flow
Navigate to the returned URI in a web browser and complete the authentication flow with your identity provider.
Step 3: Create a MeasurementConsumer
Before you can create measurements, you need to register as a MeasurementConsumer:Save the MeasurementConsumer resource name - you’ll need it to create measurements.
Step 4: Create Your First Measurement
Now you’re ready to create a measurement! Let’s create a simple reach measurement:Step 5: Check Measurement Status
Measurements are processed asynchronously. Poll the measurement status to check progress:Next Steps
Congratulations! You’ve successfully: ✅ Set up your development environment✅ Authenticated with the API
✅ Created a MeasurementConsumer
✅ Created and monitored your first measurement
Dive Deeper
Core Concepts
Learn about the architecture and key concepts
Authentication Guide
Deep dive into authentication and security
Creating Measurements
Comprehensive guide to measurement creation
API Reference
Explore the complete API documentation
Troubleshooting
Authentication Failed
Authentication Failed
Problem: Unable to obtain an ID token.Solutions:
- Verify your OpenID Provider is configured correctly
- Check that your redirect URI matches the configured value
- Ensure your account has the necessary permissions
MeasurementConsumer Creation Failed
MeasurementConsumer Creation Failed
Problem: CreateMeasurementConsumer returns an error.Solutions:
- Verify your creation token is valid and unused
- Check that your certificate is properly formatted X.509 DER
- Ensure you’re passing valid authentication metadata
Measurement Stays in PENDING State
Measurement Stays in PENDING State
Problem: Measurement doesn’t progress beyond PENDING.Solutions:
- Verify all specified data providers exist
- Check that event groups have data in the measurement time range
- Ensure requisitions are being fulfilled by data providers
- Review the Kingdom logs for detailed error messages
gRPC Connection Errors
gRPC Connection Errors
Problem: Cannot connect to the API endpoint.Solutions:
- Verify the API endpoint URL and port
- Check that you’re using TLS/SSL credentials
- Ensure your network allows gRPC traffic
- Verify the server certificate is trusted
Getting Help
GitHub Repository
Report issues, contribute, or browse the source code
