/bulk POST
Overview
Run API calls in bulk.
Summary
This request will run a sequence of API requests within one query. The requests are executed sequentially and their results
are returned as one response. Some requests may return failure code, that does not interrupt the execution of the batch,
and the overall request will still be considered successful.
Request Arguments
Name |
Type |
Description |
Required |
requests
|
Array
|
The list of requests
|
True
|
Each of the requests can have the following fields:
Name |
Type |
Description |
Required |
url
|
String
|
The request URL, starting with version.
|
True
|
data
|
JSON String
|
The data for the POST/PUT body. Must be a JSON-encoded string.
|
False
|
headers
|
Array
|
The request headers
|
False
|
method
|
String
|
The HTTP method (default is GET)
|
False
|
Request Example
{"requests":
[
{
"url": "/v10/Accounts", "method": "POST", "data": "{\"name\": \"test123\"}"
},
{
"url": "/v10/Accounts", "method": "GET"
}
]
}
Response
The response will contain an array of response objects, each of them will correspond to the individual request. The following fields are in the response objects:
Name |
Type |
Description |
contents
|
Array or String
|
The response contents, can be JSON object or string depending on what the individual request is supposed to return.
|
headers
|
Array
|
The response headers
|
status
|
Integer
|
HTTP status code of the response. Will be 2XX for successful requests and 4XX or 5XX for errors.
|
Response Example
[
{
"contents": {
"my_favorite": false,
"following": true,
"id": "7d2e21a6-8a76-a74f-bb53-535620211304",
"name": "test123",
"date_entered": "2014-04-22T03:56:24-04:00",
"_module": "Accounts"
},
"headers": [],
"status": 200
},
{
"contents": {
"next_offset": -1,
"records": [
{
"my_favorite": false,
"following": true,
"id": "7d2e21a6-8a76-a74f-bb53-535620211304",
"name": "test123",
"date_entered": "2014-04-22T03:56:24-04:00",
"date_modified": "2014-04-22T03:56:24-04:00",
}
]
},
"headers": [],
"status": null
}
]
Change Log
Version |
Change |
v10
|
Added /bulk POST endpoint.
|