View
See create to see an introduction about Audience API.
API Description
Get information about an audience.
API Key Authentication
Authentication is required in order to interact with Batch's APIs.
Batch implements authentication using API Keys, that we call the "REST API Key". You can find it on your dashboard.
Please make sure that you keep this key secret. You should never use it in client apps to call APIs from there as it would easily be extractable.
How to authenticate
In order to authenticate your requests, add your REST API Key in the Authorization header and prefix it by Bearer. Example: Authorization: Bearer bcd38d9rfb38ra28.
The name of the existing audience you want to view.
The indexing token returned by the create, replace, update or remove routes.
The unique project key, identifying a project on the Batch platform
project_0664hxvwffvbpn278gxdyhsadddqgna6If the GET to the API endpoint is successful you will receive an HTTP 200 confirmation and information about your audience.
The request is malformed
The Rest API Key is not valid for this project
Not found
Too Many Requests
Unexpected error
Batch's services are under maintenance. Please try again later
GET /2.8/audiences/view?name=text HTTP/1.1
Host: api.batch.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-Batch-Project: text
Accept: */*
{
"name": "text",
"display_name": "text",
"type": "CUSTOM_ID",
"nb_ids": 1,
"indexing_state": "APPLIED",
"created": "2023-08-12T22:30:05Z",
"updated": "2023-08-12T22:30:05Z"
}Request structure
Route
The Audience API exposes a GET endpoint that allows to get information about a audience :
/audiences/view
Headers and authentication
See Overview → Using Project APIs.
Query parameters
See the API Description.
Responses
Success
If the GET to the API endpoint is successful you will receive an HTTP 200 confirmation and information about your audience.
{
"name": "string",
"display_name": "MBE123",
"type": "CUSTOM_ID",
"nb_ids": 2,
"indexing_state": "APPLIED",
"created": "2023-10-03T09:35:08Z",
"updated": "2023-10-03T09:35:08Z"
}
The indexing state is the indexing state of the update that returned the given indexing token. If there is no indexing token provided, the state of the last update will be used.
3 values are possible for indexing state
IN_PROGRESS: update processing is in progressAPPLIED: update processing is finishedREPLACED: the audience content has been replaced since the issue of the indexing token.
Failure
If the POST data does not meet the API requirements you will receive an actionable error message. Contact us at support@batch.com if you need further support.
See the list of potential failures in the API Description.
Last updated

