This document applies to Case Manager Web Service v2.x.
The web service is accessible over HTTPS. All request and response payloads are transmitted as JSON using the UTF-8 character set.
Request Specification
- URL: https://<casemanager-server>/processBatch
- Method: POST
-
Required Headers
- accept: application/json
- content-type: application/json; charset=utf-8
- authorisation: Bearer <access-token>
Payload
Each submission’s payload should be structured as defined below.
{
"operations": [
{
"type": "<operation type identifier>",
"ref": "<created record reference>",
"data": <operation data object>
}
]
}
The operations array contains entries for each operation to be performed in the batch. Each operation is processed in the order, and all must succeed for the batch to be processed successfully; otherwise the whole batch fails and any changes are undone.
The properties of the operation are as follows:
Property |
Description |
Data Type |
Required |
---|---|---|---|
type |
The type of operation to perform. |
String |
Yes |
ref |
A unique reference within the batch for the record created by this operation that can be used in subsequent operations in the batch to refer to the created record. |
String |
No |
data |
The data for the operation. |
Object |
Yes |
See the Operations section below for details of available operations.
Success Response
If batch processing succeeds, the server will respond with status code 200, and a JSON payload with the following structure.
{
"operations": [
{
"type": "<operation type identifier>",
"event": <event data object>,
"ref": "<created record reference>"
}
]
}
The operations array contains an entry for every operation that was performed in the same order they were supplied and processed.
The properties of each operation in the response are as follows:
Property |
Description |
Data Type |
---|---|---|
type |
The type of operation. |
String |
event |
An object that describes the outcome of the operation. |
Object |
ref |
The reference that was supplied for the operation, if any. |
String |
Failure Response
Upon receipt of an invalid batch, or when an error occurs during the processing of a batch, the web service returns an failure response. The response will have an HTTP error code of:
- 400 if an invalid data structure or value was submitted
- 401 if authorisation fails
- 403 if client certificate is not included as part of the request, or if the userId is invalid for the submission
- 429 if the number of requests exceeds the rate limit (currently 1 request per second)
- 500 if an internal processing error occurs within Case Manager
For 400 responses where the data was well-formed but contained an invalid property value, a JSON response body with the following structure should be returned.
{
"message": ""
"errors": [
{
"context": string,
"error": string,
"value": any
}
]
}
Property |
Description |
Data Type |
---|---|---|
message |
A general error message. |
String |
errors |
Array of field level errors. |
Array |
context
|
A JSON path to the invalid property in the submitted payload. |
String |
error
|
A description of the validation failure. |
String |
value
|
The invalid value that was submitted. |
any |
Pete Patel
Comments