/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":"v11/integrate/Contacts/sync_key/sync_key_test",
"method":"PATCH",
"data":{"title":"Recruiting Manager_","name":"2", "fields":["id","sync_key","name","title", "first_name"]}
},
{
"url":"v11/integrate/Accounts/sync_key/sync_key_test",
"method":"PATCH",
"data":{"name":"New Name", "fields":"1"}
}
]
}
Note: In the data request you may specify fields attribute as part of the payload, if
['fields']
param provided (it is optional) in the request body (in 'data
' param) we handle this as a list of responsive fields. It could be passed via string with fields separated by comma or an array of strings.
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": {
"record": {
"id": "dd21a094-e78a-11ee-ac3a-02d786a79729",
"name": "",
"first_name": "",
"title": "Recruiting Manager_",
"sync_key": "sync_key_test"
}
},
"headers": [],
"status": 200,
"status_text": "OK"
},
{
"contents": {
"record": []
},
"headers": [],
"status": 200,
"status_text": "OK"
}
]
Change Log
Version | Change |
---|---|
v11_25 | Updated /bulk to return extra fields as per request |
v10 | Added /bulk POST endpoint. |