Batch Interaction API
Use the Batch Interaction API to send interaction and interaction update requests in batches of up to 5,000 records using current or historical timestamps on the events. Batch interactions do not trigger online optimization points, but offline optimization points.
Authentication and authorization
MXO security framework uses OAuth 2.0 for authenticating access to data. For detailed information on how to create API credentials for a user and request an OAuth 2.0 token from MXO, see MXO API security.
Available API calls
We provide the API calls listed below:
| Method | Summary | Details |
|---|---|---|
| POST | /batchv2/interactions/{siteKey} | Process a batch of interaction requests. |
| POST | /batchv2/interactions/{siteKey}/update | Process a batch of interaction update requests. |
| GET | /batchv2/interactions/{siteKey}/{batchId} | Retrieve the current status of a batch processing job. |
| GET | /batchv2/interactions/{siteKey}/{batchId}/error | Retrieve any errors that occurred during batch processing. |
Example use cases
The Batch Interaction API is primarily used for two key purposes:
Loading historical events at initial implementation to prime your workspace with data for analysis.
Uploading events from a system MXO is not listening to.
Example parameters
| Field | Description |
|---|---|
| siteKey | Site identifier key. |
Example API call - Request
| Field | Description |
|---|---|
| Request Method | POST |
| Request URL | /batchv2/interactions/{siteKey} |
| Request Headers | workspaceId: NzM3MjE Content-Type: application/json |
| Request Body |
|
Example API call - Response
Expected response code
200 Batch processed successfullyExpected response body
{
"rejectedCount": 0,
"acceptedCount": 0,
"totalCount": 2,
"batchId": "3df46dbd-59f4-406c-8462-374df55cbaaf"
}Possible error response code
400 Bad request or duplicate batch IDError response body
{
"errorMessage": "Batch ID: test already exists",
"batchId": "3df46dbd-59f4-406c-8462-374df55cbaaf"
}