This article lists the ToolWatch API requests for status codes: Create, Retrieve, and Retrieve List. Every request needs an authorization token. To get one, see ToolWatch API: Authorization.
Create
Request
URI
https://api.{cluster}.toolwatch.net/statuscodesHttp Method
POST
Headers
Authorization: {token}
Request Body
Field | Type | Required | Description |
Description | string | Yes | Status code description. |
Number | string | Yes | Status code number. |
Response
201 Created
The response header contains the URI for the newly created status code.
Location: https://api.{cluster}.toolwatch.net/statuscodes/{id}400 Bad Request
Triggered when field level validation fails.
Response body will contain validation message
[
{
"PropertyName": "Number",
"Message": "Please provide a status code number.",
"AttemptedValue": ""
}
]
Retrieve
Request
URI
https://api.{cluster}.toolwatch.net/statuscodes/{id}Allowable querystring parameters
Parameter | Description |
columns | Comma-separated list of properties to return. |
Http Method
GET
Headers
Authorization: {token}
Request Body
Not allowed for GET
Response
200 Ok
By default every property is returned. Use the columns querystring parameter to limit the response to specific properties.
Field | Type | Description |
Id | guid | Unique identifier. |
Number | string | Status code number. |
Description | string | Status code description. |
IsTransferProhibited | boolean | Whether transfers are prohibited for this status. |
IsNeedingService | boolean | Whether the status flags an item as needing service. |
IsDestroyed | boolean | Whether the status flags an item as destroyed. |
IsSendToLostFound | boolean | Whether the status sends an item to lost and found. |
Deleted | boolean | Whether the status code is deleted. |
Inactive | boolean | Whether the status code is inactive. |
Example response body:
{
"Id": "{id}",
"Number": "Status Code Number",
"Description": "Status Code",
"Deleted": false,
"Inactive": false
}404 Not Found
Triggered when id parameter is not a valid guid or no matching record was found.
Response body will contain error message
{id} is not a valid status code id.Retrieve List
Request
URI
https://api.{cluster}.toolwatch.net/statuscodesAllowable querystring parameters
Parameter | Description |
columns | Comma-separated list of properties to return. |
Http Method
GET
Headers
Authorization: {token}
Request Body
Not allowed for GET
Response
200 Ok
By default every property is returned. Use the columns querystring parameter to limit the response to specific properties.
Field | Type | Description |
Id | guid | Unique identifier. |
Number | string | Status code number. |
Description | string | Status code description. |
IsTransferProhibited | boolean | Whether transfers are prohibited for this status. |
IsNeedingService | boolean | Whether the status flags an item as needing service. |
IsDestroyed | boolean | Whether the status flags an item as destroyed. |
IsSendToLostFound | boolean | Whether the status sends an item to lost and found. |
Deleted | boolean | Whether the status code is deleted. |
Inactive | boolean | Whether the status code is inactive. |
Example response body:
[
{
"Id": "849197e3-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Status Code Number 1",
"Description": "Status Code 1",
"Deleted": false,
"Inactive": false
},
{
"Id": "cc09dbb0-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Status Code Number 2",
"Description": "Status Code 2",
"Deleted": false,
"Inactive": false
}
]
404 Not Found
Triggered when field parameters in querystring are not allowed.
Response body will contain error message
{"Message":"Criteria is invalid","Type":"Exception"}