Response Codes
Here are the common response codes for the Target Admin APIs.
Status | Meaning | Description |
---|---|---|
200 | OK | OK |
400 | Bad Request | Bad Request. Most probably the data provided in the request is invalid. |
401 | Unauthorized | The user is not allowed to perform this operation. |
403 | Forbidden | Access to this resource is forbidden. |
404 | Not Found | The referenced resource was not found. |
Activities
An activity enables you to test or personalize content for your users. Activities may be one of the following types:
Batch Updates
Multiple Admin APIs can be executed as a single batch request.
Execute Calls in Batch
POST /{tenant}/target/batch
Stack multiple API calls together and execute them in a single batch.
Batching allows you to pass instructions for several operations in a single HTTP request. You can also specify dependencies between related operations (described in a section below). TNT will process each of your independent operations (possibly in parallel) and will process your dependent operations sequentially. Once all operations have been completed, a consolidated response will be passed back and the HTTP connection will be closed.
The batch API takes in an array of logical HTTP requests represented as JSON arrays - each request has a method (corresponding to HTTP method GET/PUT/POST/DELETE etc.), a relativeUrl (the portion of the URL after admin/rest/), optional headers array (corresponding to HTTP headers) and an optional body (for POST and PUT requests). The Batch API returns an array of logical HTTP responses represented as JSON arrays - each response has a status code, an optional headers array and an optional body (which is a JSON encoded string). To make batched requests build a JSON object which describes each individual operation to perform. The number of maximum allowed operations are 256 (from 0 to 255).
Specifying dependencies between operations in the request By default, the operations specified in the batch API request are independent - they can be executed in arbitrary order on the server and an error in one operation does not affect execution of other operations.
Often, the operations in the request are dependent - for example, the output of one operation may be used in the input of the next operation. For example offer created in operationId=0 needs to be used in campaign creation operationId=1.
In order to link two batch operations together specify in the dependent operation the id of the required operation, for instance: “dependsOnOperationId” : 5. Also IDs of created resources via POST requests of batch operations can be used in dependent operations both in “relativeUrl” and “body”.
Permissions & Throttling
In order to execute batch API actions the underlying user has to have at least “editor” rights (for each individual operation in case additional rights are required than user has then the individual operation will fail). Usual throttling strategies are applied on batch API actions as if every operation has been performed individually.
Batch processing finishes when all operations have been completed, an operation could either be successful (2xx statusCode), failure (4xx, 5xx status code) or skipped because a dependency operation has failed or has been skipped.
Request Object Parameters
Attribute | Description | Limits | Default |
---|---|---|---|
body | body for HTTP batch operation. will be ignored for all actions but POST and PUT. can refer to IDs from previous batch actions, for instance: “offerId”: “{operationIdResponse:0}”, “segmentId”: “{operationIdResponse:1}” | should be a valid JSON; in case referencing an operationIdResponse, the operationId response referred should be a valid ID and the method on that action should be POST | empty object {} |
dependsOnOperationIds | list of constraint IDs that will assure that current operation will execute only if specified operations have completed successfully. Can be used to achieve chaining of operations. | maximum 255 operations are allowed; unique values are only allowed; should point to a valid operationId in the array; cyclical dependencies are not allowed | |
headers | array of key-value headers to be sent with particular operation. In case authentication for batch API has been performed via Authorization header, it will be copied for individual operations as well. | max number of headers in array allowed is 50 | Content-Type: application/json |
headers->name | header name | should be unique among other header names. headers are case insensitive by rfc, otherwise the values will override each other. | |
headers->value | header value | N/A | empty string |
method | HTTP method to use. Available options: GET, POST, PUT, PATCH, DELETE | only GET, POST, PUT, PATCH, DELETE methods are allowed | |
operationId | operation ID used to identify an operation among other operations for responses and referencing results. | unique among other operations; values from 0-255 | |
operations | list of operations to perform in a batch. order is not relevant. | maximum 256 operations are allowed | |
relativeUrl | relative URL for admin rest API, the part after “/admin/rest/”. Can contain query string parameters like: “/v2/campaigns?limit=10&offset=10”. can refer to URLs with contain IDs from previous batch actions, for instance: “/v1/offers/{operationIdResponse:0}”. In case query parameters are sent they have to be URL encoded. | should start with / (be relative); only new valid JSON APIs are supported; in case of invalid relativeURL a 404 response for particular operation will be returned; in case referencing an operationIdResponse, the operationId response referred should be a valid ID and the method on that action should be POST |
Sample Request Object
{
"operations": [
{
"operationId": 1,
"dependsOnOperationIds~": [0],
"method": "POST",
"relativeUrl": "/v1/offers",
"headers~": [
{
"name": "Content-Type",
"value": "application/json"
}
],
"body~": {
"key": "value"
}
}
]
}
Response Object Parameters
Parameter | Description |
---|---|
operationId | operation ID used to identify an operation among other operations, same ID as it has been sent in POST request. |
skipped | boolen flag to mark if operation has been executed or skipped. Will be true in case that current operation depends on a operation which has failed (returned a statusCode value different than 2xx). |
statusCode | returned then all depending operations will be skipped (not executed). |
headers | array of key-value headers to be sent as a response for particular operation. |
headers->name | header name |
headers->value | header value |
body | body for HTTP batch response operation |
Sample Response Object
{
"results": [
{
"operationId": 1,
"skipped~": false,
"statusCode~": 200,
"headers~": [
{
"name": "Content-Type",
"value": "application/json; charset=UTF-8"
}
],
"body~": {
"id": 5
}
}
]
}
Personalization & Experiementation Excellence with Recommendations and AI
Adobe Customer Success Webinars
Tuesday, Mar 4, 4:00 PM UTC
Adobe Target innovations, including GenAI, and best practices on AI-powered personalization and experimentation at scale.
RegisterAdobe Target at Summit
Register for these developer sessions:
- Put the Customer at the Center and Build Relationships That Last a Lifetime (attend online)
- Get Inspired and Scale Faster with Generative Experiments
- How to Scale and Transform Your Organization to Omnichannel Communications
- The Secret to Next-Level Mobile App Engagement and Growth
- Unlocking Digital Growth: Marriott’s Success with Adobe Experience Manager
Connect with Experience League at Summit!
Get front-row access to top sessions, hands-on activities, and networking—wherever you are!
Learn more