POST /batch
This resource allows to combine multiple requests.
Content-Type and Accept
application/json is the only supported type for the request body and the response body.
Http Codes
Only Application/Json is supported
If this parameter is not present during the request, and error 415 Unsupported Media Type will be thrown.
Located in : Header
Example values : content-type:application/json
Object Name: Request
Property Name | Type | Description | Method |
---|---|---|---|
Id (optional) |
String | This property is used to uniquely tag sub-requests. The response body will contain the associated id of each request making it easier to parse the response. | POST |
Method (optional) |
String | Allowed values: POST, GET, PUT, DELETE Default value: POST |
GET POST |
Path (required) |
String | The path of the request.Query Parameters are supported. | GET POST |
Body | Object | Not required but expected for POST and PUT requests. The type can be json format or escaped xml strings. * Escaped characters for xml string * Backspace is replaced with \b * Newline is replaced with \n * Carriage return is replaced with \r * Tab is replaced with \t * Double quote is replaced with " * Backslash is replaced with \ |
POST |
Headers (optional) |
Object | This is the header in json format used for the request: | GET POST |
\t\"headers\": {
\t\"accept\":\"application/xml\"
\t\"content-Type\":\"application/xml\"
\t}
Object Name: Requests
Property Name | Type | Description | Method |
---|---|---|---|
Requests |
Array <Request> |
POST |
URL Example: https://0.0.0.0/api/rest/v1/batch
[
{
"id": "Simple GET Request",
"method": "GET",
"path": "/api/rest/v1/info"
},
{
"id": "Simple GET Request with parameter (query String) in the path",
"method": "GET",
"path": "/api/rest/v1/info?encode=xml"
},
{
"id": "Simple GET Request with header",
"method": "GET",
"path": "/api/rest/v1/info",
"headers": {
"accept": "application/xml"
}
},
{
"id": "POST request with JSON body",
"method": "POST",
"path": "/api/rest/v1/system/date-time?dateFormat=YYYY-MM-DD&timeFormat=hh:mm",
"body": {
"date": "02-11-2020",
"time": "09:19:00",
"timeZone": "America/New_York",
"autoTime": true,
"ntpServer": "time.windows.com"
}
},
{
"id": "POST request with XML body(requires content-Type:application/xml)",
"method": "POST",
"path": "/api/rest/v1/system/date-time?dateFormat=YYYY-MM-DD&timeFormat=hh:mm",
"headers": {
"content-Type": "application/xml"
},
"body": "<DateTime>
\t<AutoTime>true</AutoTime>
\t<NtpServer>time.windows.com</NtpServer>
</DateTime>"
}
]
URL Example: https://0.0.0.0/api/rest/v1/batch
[
{
"id": "Simple GET Request",
"method": "GET",
"path": "/api/rest/v1/info"
},
{
"id": "Simple GET Request with parameter (query String) in the path",
"method": "GET",
"path": "/api/rest/v1/info?encode=xml"
},
{
"id": "Simple GET Request with header",
"method": "GET",
"path": "/api/rest/v1/info",
"headers": {
"accept": "application/xml"
}
},
{
"id": "POST request with JSON body",
"method": "POST",
"path": "/api/rest/v1/system/date-time?dateFormat=YYYY-MM-DD&timeFormat=hh:mm",
"body": {
"date": "02-11-2020",
"time": "09:19:00",
"timeZone": "America/New_York",
"autoTime": true,
"ntpServer": "time.windows.com"
}
},
{
"id": "POST request with XML body(requires content-Type:application/xml)",
"method": "POST",
"path": "/api/rest/v1/system/date-time?dateFormat=YYYY-MM-DD&timeFormat=hh:mm",
"headers": {
"content-Type": "application/xml"
},
"body": "<DateTime>
\t<AutoTime>true</AutoTime>
\t<NtpServer>time.windows.com</NtpServer>
</DateTime>"
}
]