Introduction
The Process Manager implements the following public API to allow users to create work processes which will be handled by worker instances. Each type of worker will require specific input parameters and return their own output data. See the documentation for those workers for additional details:
Workers
Available URLs
URL | Description |
---|---|
POST /v1/processes/{processType} | |
GET /v1/processes/{processType}/{processId} |
POST /v1/processes/{processType}
Creates and starts a new process.
NOTE: There is a deprecated alias for this route: POST /v4/processes/{processType}.
Request
URL Parameters
Parameter | Description |
---|---|
{processType} |
The type of process desired. See worker documentation for more details. |
Request Headers
Name | Description |
---|---|
Content-Type |
Must be application/json |
Request Body
JSON object conforming to the following:
input
- Worker specific input parameters. See worker documentation for more details.
Successful Response
Response body
JSON object with the following properties:
input
(Object) A copy of the request bodyinput
object.processId
(String) The id of the new OCR process.expirationDateTime
(String) The date and time (in ISO 8601 Extended Format) when the OCR process will be deleted.state
(String) The current state of the OCR process running on the server. The response will always be"processing"
.
Error Responses
Error response will have the http status code set to one of following values and the JSON object will contain a property errorCode
indicating the type of error:
Status Code | JSON errorCode |
Description |
---|---|---|
480 |
"MissingInput" |
A required input value was not provided. See errorDetails in the response body. |
480 |
"InvalidInput" |
An invalid input value was used. See errorDetails in the response body. |
480 |
"UnrecognizedInput" |
An unrecognized JSON property was provided. See errorDetails in the response body. |
580 |
"InternalError" |
The server encountered an internal error when handling the request. |
GET /v1/processes/{processType}/{processId}
Gets the state and result of an existing process created by POST /v1/processes/(processType). Requests can be sent to this URL repeatedly while state
is "processing"
.
When state
is "complete"
the response will include a result object which contains the output from the worker process. See worker documentation for more details.
If the process encountered an error, the state
property will be set to "error"
and the errorCode
property will contain an error code string.
NOTE: There is a deprecated alias for this route: GET /v4/processes/{processType}/{processId}.
Request
URL Parameters
Parameter | Description |
---|---|
{processType} |
The type of process. See worker documentation |
for more details. {processId}
| The id of the process returned in the JSON body response to [POST /v1/processes/{processType}]
Successful Response
Response body
JSON object with the following properties:
input
(Object) A copy of the POST /v1/processes/{processType} request bodyinput
object we accepted to create the process.processId
(String) The id of the process.expirationDateTime
(String) The date and time (in ISO 8601 Extended Format) when the process will be deleted.state
(String) The current state of the process running on the server. It will be one of the following values:"processing"
- The process is in progress."complete"
- The process is completed."error"
- The process returns an error.
errorCode
(String) An error code string if a problem occurred during the process. Only present whenstate
is"error"
.output
(Object) Describes the output result. Only present whenstate
is"complete"
. See worker documentation for more details.
Error Responses
Error response will have http status code set to one of following values and the JSON object will contain a property errorCode
indicating the type of error:
Status Code | JSON errorCode |
Description |
---|---|---|
410 |
"ResourceExpired" |
Process specified by {processId} has expired. |
404 |
"ResourceNotFound" |
Process specified by {processId} could not be found. |
200 |
"InvalidInput" |
An invalid input value was used. See errorDetails in the response body. |
580 |
"InternalError" |
The server encountered an internal error when handling the request. |
Workers may implement additional error types. See worker documentation for more details.