This article lists the ToolWatch API requests for models: Create, Retrieve, Retrieve List, and Retrieve Image. Every request needs an authorization token. To get one, see ToolWatch API: Authorization.
Create
Request
URI
https://api.{cluster}.toolwatch.net/modelsHttp Method
POST
Headers
Authorization: {token}
Request Body
Field | Type | Required | Description |
Id | guid | Yes | Model id (guid you generate). |
Number | string | Yes | Model number. Max 50 characters. |
DescriptionId | guid | Yes | Description id. |
CategoryId | guid | Yes | Category id. |
ItemType | string | Yes | Item type. One of T, Q, M, E. |
Model | string | No | Model name. Max 50 characters. |
ModelYear | integer | No | Model year. |
Upc | string | No | UPC. Max 50 characters. |
ManufacturerId | guid | No | Manufacturer id. |
ManufacturerDescription | string | No | Manufacturer description. Max 200 characters. |
CatalogNumber | string | No | Catalog (manufacturer part) number. |
Msrp | decimal | No | Manufacturer suggested retail price. |
ReplacementCost | decimal | No | Replacement cost. |
DefaultClassId | guid | No | Default class id. |
DefaultCertificationId | guid | No | Default certification id. |
Response
201 Created
The response header contains the URI for the newly created model.
Location: https://api.{cluster}.toolwatch.net/models/{id}400 Bad Request
Triggered when field level validation fails.
Response body will contain validation message
[
{
"PropertyName": "Number",
"Message": "Please provide a model number.",
"AttemptedValue": ""
}
]
Retrieve
Request
URI
https://api.{cluster}.toolwatch.net/models/{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 | Model number. |
DescriptionId | guid | Description id. |
Description | string | Description. |
CategoryId | guid | Category id. |
Category | string | Category name. |
ItemType | string | Item type. One of T, Q, M, E. |
Model | string | Model name. |
ModelYear | integer | Model year. |
Upc | string | UPC. |
ManufacturerId | guid | Manufacturer id. |
ManufacturerDescription | string | Manufacturer description. |
CatalogNumber | string | Catalog (manufacturer part) number. |
Msrp | decimal | Manufacturer suggested retail price. |
ReplacementCost | decimal | Replacement cost. |
DefaultClassId | guid | Default class id. |
DefaultCertificationId | guid | Default certification id. |
ImageUrl | string | URL of the model image, or null if no image. |
isDeleted | boolean | Whether the model is deleted. |
MasterSubTypeId | guid | Master sub-type id. |
Example response body:
{
"Id": "{id}",
"Number": "Model Number",
"Description": "Model Description",
"Category": "Category",
"ItemType": "T",
"ImageUrl": "https://.../{id}.jpg"
}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 model id.Retrieve List
Request
URI
https://api.{cluster}.toolwatch.net/modelsAllowable querystring parameters
Parameter | Description |
columns | Comma-separated list of properties to return. |
number | Filter by model number. |
type | Filter by item type (T, Q, M, E). |
model | Filter by model name. |
isdeleted | Filter by deleted flag (true or false). |
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 | Model number. |
DescriptionId | guid | Description id. |
Description | string | Description. |
CategoryId | guid | Category id. |
Category | string | Category name. |
ItemType | string | Item type. One of T, Q, M, E. |
Model | string | Model name. |
ModelYear | integer | Model year. |
Upc | string | UPC. |
ManufacturerId | guid | Manufacturer id. |
ManufacturerDescription | string | Manufacturer description. |
CatalogNumber | string | Catalog (manufacturer part) number. |
Msrp | decimal | Manufacturer suggested retail price. |
ReplacementCost | decimal | Replacement cost. |
DefaultClassId | guid | Default class id. |
DefaultCertificationId | guid | Default certification id. |
ImageUrl | string | URL of the model image, or null if no image. |
isDeleted | boolean | Whether the model is deleted. |
MasterSubTypeId | guid | Master sub-type id. |
Example response body:
[
{
"Id": "849197e3-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Model Number 1",
"Description": "Model Description 1",
"Category": "Category 1",
"ItemType": "T",
"ImageUrl": "https://.../849197e3-6cc4-4150-ae71-3f2fc1fbc53d.jpg"
},
{
"Id": "cc09dbb0-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Model Number 2",
"Description": "Model Description 2",
"Category": "Category 2",
"ItemType": "Q",
"ImageUrl": null
}
]
404 Not Found
Triggered when field parameters in querystring are not allowed.
Response body will contain error message
{"Message":"Criteria is invalid","Type":"Exception"}Retrieve Image
Request
URI
https://api.{cluster}.toolwatch.net/models/{id}/imageHttp Method
GET
Headers
Authorization: {token}
Request Body
Not allowed for GET
Response
200 Ok
Returns the JPEG image (image/jpg) of the model identified by {id}. This endpoint returns binary image data, not JSON.
404 Not Found
Triggered when id parameter is not a valid guid, or no matching model image was found.
Response body will contain error message
{id} is not a valid model id, or Image not found.