Skip to main content

ToolWatch API: Classes

ToolWatch API requests to create, retrieve, and list classes, with URIs, headers, fields, and example responses.

This article lists the ToolWatch API requests for classes: 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/classes

Http Method

POST

Headers

Authorization: {token}

Request Body

Field

Type

Required

Description

Number

string

Yes

Class number.

Description

string

No

Class description.

Response

201 Created

The response header contains the URI for the newly created class.

Location: https://api.{cluster}.toolwatch.net/classes/{id}

400 Bad Request

Triggered when field level validation fails.

Response body will contain validation message

[
{
"PropertyName": "Number",
"Message": "Please provide a class number.",
"AttemptedValue": ""
}
]

Retrieve

Request

URI

https://api.{cluster}.toolwatch.net/classes/{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

Class number.

Description

string

Class description.

Example response body:

{
"Id": "{id}",
"Number": "Class Number",
"Description": "Class"
}

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 class id.

Retrieve List

Request

URI

https://api.{cluster}.toolwatch.net/classes

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

Class number.

Description

string

Class description.

Example response body:

[
{
"Id": "849197e3-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Class Number 1",
"Description": "Class 1"
},
{
"Id": "cc09dbb0-6cc4-4150-ae71-3f2fc1fbc53d",
"Number": "Class Number 2",
"Description": "Class 2"
}
]

404 Not Found

Triggered when field parameters in querystring are not allowed.

Response body will contain error message

{"Message":"Criteria is invalid","Type":"Exception"}
Did this answer your question?