Introduction to the Walr Buyer API
This guide provides a comprehensive overview of the Walr Buyer API, which enables programmatic creation and management of Walr Audiences and Samples. The API allows external partners to integrate Walr's audience targeting capabilities directly into their applications and workflows.
Quick Start
- Obtain your API credentials
- Set up your first project
- Create and manage samples
- Monitor and control your samples
Prerequisites
Before you begin, ensure you have:
- A valid Walr account with API access
- A bearer token for authentication
- Understanding of your target audience requirements
- Test and live URLs for your surveys
To obtain your bearer token, follow the instructions in our authentication guide.
API Overview
The Walr Buyer API provides a complete set of endpoints for managing the entire lifecycle of audience samples. Key features include:
- Project Management: Create and manage research projects
- Sample Creation: Define and configure audience samples with detailed targeting criteria
- Pricing & Feasibility: Get real-time pricing and feasibility information
- Sample Control: Launch, pause, and close samples programmatically
Getting Started
Base URLs
Environment | URL |
---|---|
Staging | https://api-staging.walr.com/au/buyers |
Production | https://api.walr.com/au/buyers |
Authentication
All API requests require authentication using a bearer token:
Authorization: Bearer YOUR_API_KEY
Typical Workflow
The Buyer API follows a structured workflow for creating and managing samples. Here's a detailed breakdown of the typical process:
Project Setup
- Create a new project using the Create Project endpoint
- Store the returned Project ID for subsequent operations
Sample Creation
- Create a sample within your project using the Project ID
- Define targeting criteria, screening questions, and quotas
- Specify sample size, incidence rate, and length of interview
- Set test and live URLs for your survey
Sample Review Process
- The sample will be processed by Walr's system
- Monitor the sample status using Get Sample Details
- Possible status transitions:
- Submitted → Accepted/Declined
- Accepted → Live (after price acceptance)
- Live → Paused/Completed
Pricing and Feasibility
- Check sample feasibility using Get Sample Feasibility
- Review pricing details using Get Sample Pricing
- The price is valid for a limited time (indicated by the priceKey)
Sample Activation
- If the price is acceptable, accept it using Accept Sample Pricing
- Launch the sample using Launch Sample
- Monitor the sample's progress through Get Sample Details
Sample Management
- Use Update Sample to modify parameters if needed
- Hold Sample to temporarily pause data collection
- Close Sample when data collection is complete
Status Flow Diagram
Submitted → Accepted → Live → Completed
↓ ↓ ↓
Declined Paused InReconciliation
API Reference
1. Create a Project
Creates a new project in your account.
Endpoint: POST /projects
Request Body:
{
"name": "New Project",
"description": "Description of the project"
}
Response: 201 Created
{
"id": "project-123",
"name": "New Project",
"description": "Description of the project",
"createdAt": "2024-01-01T00:00:00Z"
}
2. Get Project Details
Retrieves details about a specific project.
Endpoint: GET /projects/{projectid}
Query Parameters:
includeAudiences
(boolean, optional): Include samples in the response
Response: 200 OK
{
"id": "project-123",
"name": "New Project",
"description": "Description of the project",
"samples": [
{
"id": "sample-456",
"name": "Sample 1",
"status": "Live"
}
]
}
3. Create Sample
Creates a new sample within a project.
Endpoint: POST /projects/{projectid}/samples
Request Body:
{
"name": "My Sample",
"market": "eng_us",
"quantity": 1000,
"incidenceRate": 90,
"lengthOfInterview": 15,
"liveUrl": "https://example.com/live",
"testUrl": "https://example.com/test",
"containsPersonalData": false,
"notes": "Sample notes",
"targeting": {
"type": "NatRep"
},
"targetEndDate": "2024-12-31T23:59:59Z",
"panelSources": [
"A"
]
}
Response: 201 Created
{
"id": "sample-456",
"name": "My Sample",
"status": "Submitted",
"createdAt": "2024-01-01T00:00:00Z"
}
4. Get Sample Details
Retrieves details about a specific sample.
Endpoint: GET /projects/{projectid}/samples/{sampleId}
Response: 200 OK
{
"id": "sample-456",
"name": "My Sample",
"status": "Accepted",
"market": "eng_us",
"quantity": 1000,
"incidenceRate": 90,
"lengthOfInterview": 15,
"liveUrl": "https://example.com/live",
"testUrl": "https://example.com/test",
"containsPersonalData": false,
"notes": "Sample notes",
"targeting": {
"type": "NatRep"
},
"panelSources": [
"A"
],
"targetEndDate": "2024-12-31T23:59:59Z",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
5. Update Sample
Updates an existing sample.
Endpoint: PUT /projects/{projectid}/samples/{sampleId}
Request Body:
{
"name": "US National Study",
"market": "eng_us",
"containsPersonalData": true,
"notes": "Client requested fast turnaround",
"liveUrl": "https://survey.example.com/live",
"testUrl": "https://survey.example.com/test",
"quantity": 1000,
"incidenceRate": 35,
"lengthOfInterview": 15,
"targetEndDate": "2025-05-01T00:00:00Z",
"etag": "W/\"123456789\""
}
6. Get Sample Pricing
Retrieves pricing information for a sample.
Endpoint: GET /projects/{projectid}/samples/{sampleId}/price
Response: 200 OK
{
"name": "My Sample",
"id": "sample-456",
"currency": "USD",
"price": 5000.00,
"priceKey": "A123DSD789"
}
7. Get Sample Feasibility
Checks the feasibility of a sample.
Endpoint: GET /projects/{projectid}/samples/{sampleId}/feasible
Response: 200 OK
{
"feasibilityStatus": "Feasible"
}
8. Accept Sample Pricing
Accepts the pricing for a sample.
Endpoint: PUT /projects/{projectid}/samples/{sampleId}/acceptprice
Request Body:
{
"priceKey": "A123DSD789"
}
Response: 200 OK
Error Handling
The API uses standard HTTP status codes and returns detailed error messages:
{
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid request parameters",
"details": {
"field": "quantity",
"reason": "Must be greater than 0"
}
}
}
Common error codes:
400 Bad Request
: Invalid request parameters401 Unauthorized
: Missing or invalid authentication403 Forbidden
: Insufficient permissions404 Not Found
: Resource not found500 Internal Server Error
: Server error503 Service Unavailable
: Service temporarily unavailable
Best Practices
Authentication
- Store your API key securely
- Use environment-specific keys
Error Handling
- Implement proper error handling
- Log error responses
- Implement retry logic for transient errors
Sample Management
- Monitor sample status regularly
Performance
- Cache project and sample details
- Implement rate limiting
Rate Limits
- 100 requests per minute per API key
- 1000 requests per hour per API key
- Rate limit headers included in responses
Support
For additional support:
- Email: support@walr.com
- Status page: https://status.walr.com