This article lists the ToolWatch API requests for categories: 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/categoriesHttp Method
POST
Headers
Authorization: {token}
Request Body
Field | Type | Required | Description |
Number | string | Yes | Category number. Max 25 characters. |
Type | string | Yes | Category type. Allowable values: |
Description | string | Yes | Category description. Max 50 characters. |
Inactive | boolean | No | Whether the category is inactive. |
Response
201 Created
The response header contains the URI for the newly created category.
Location: https://api.{cluster}.toolwatch.net/categories/{id}400 Bad Request
Triggered when field level validation fails.
Response body will contain validation message
[
{
"PropertyName": "Number",
"Message": "Please provide a category.",
"AttemptedValue": ""
}
]
Retrieve
Request
URI
https://api.{cluster}.toolwatch.net/categories/{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. |
OrganizationId | string | Organization the category belongs to. |
Number | string | Category number. |
Type | string | Category type ( |
Description | string | Category description. |
Deleted | boolean | Whether the category is deleted. |
Inactive | boolean | Whether the category is inactive. |
Example response body:
{
"Id": "{id}",
"Number": "Category Number",
"Type": "T",
"Description": "Category",
"Deleted": 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 category id.Retrieve List
Request
URI
https://api.{cluster}.toolwatch.net/categoriesAllowable querystring parameters
Parameter | Description |
columns | Comma-separated list of properties to return. |
number | Filter by category number. |
type | Filter by category type ( |
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. |
OrganizationId | string | Organization the category belongs to. |
Number | string | Category number. |
Type | string | Category type ( |
Description | string | Category description. |
Deleted | boolean | Whether the category is deleted. |
Inactive | boolean | Whether the category is inactive. |
Example response body:
[
{
"Id": "849197e3-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Category Number 1",
"Type": "T",
"Description": "Category 1",
"Deleted": false
},
{
"Id": "cc09dbb0-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Category Number 2",
"Type": "M",
"Description": "Category 2",
"Deleted": 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"}