Skip to main content

ToolWatch API: Locations

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

This article lists the ToolWatch API requests for locations: Create, Retrieve, Retrieve List, and Update. Every request needs an authorization token. To get one, see ToolWatch API: Authorization.

Create

Request

URI

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

Http Method

POST

Headers

Authorization: {token}

Request Body

Field

Type

Required

Description

Number

string

Yes

Location number.

Description

string

No

Location description.

StockpointId

guid

Yes

Stockpoint the location belongs to.

Stockpoint

boolean

No

Whether this location is a stockpoint.

ParentId

guid

Yes

Parent location id.

BarCode

string

No

Bar code.

Phone

string

No

Phone number.

Phone2

string

No

Secondary phone number.

Notes

string

No

Free-form notes.

Address

string

No

Street address.

Address2

string

No

Second address line.

State

string

No

State.

Zip

string

No

Zip code.

City

string

No

City.

Country

string

No

Country.

DecommissionDate

date

No

Decommission date.

CostCenterId

guid

No

Associated cost center id.

CostCodeId

guid

No

Associated cost code id.

Inactive

boolean

No

Whether the location is inactive.

Response

201 Created

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

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

400 Bad Request

Triggered when field level validation fails.

Response body will contain validation message

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

Retrieve

Request

URI

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

Location number.

Description

string

Location description.

StockpointId

guid

Stockpoint id.

Stockpoint

boolean

Whether this location is a stockpoint.

ParentId

guid

Parent location id.

BarCode

string

Bar code.

Phone

string

Phone number.

Phone2

string

Secondary phone number.

Notes

string

Free-form notes.

Address

string

Street address.

Address2

string

Second address line.

State

string

State.

Zip

string

Zip code.

City

string

City.

Country

string

Country.

DecommissionDate

date

Decommission date.

CostCenterId

guid

Associated cost center id.

CostCodeId

guid

Associated cost code id.

Inactive

boolean

Whether the location is inactive.

Example response body:

{
"Id": "d39da4c3-b42f-4d40-838c-35def0ca9789",
"Number": "s89sdfjh39",
"Description": "Main Warehouse",
"StockpointId": "d39da4c3-b42f-4d40-838c-35def0ca9789",
"Stockpoint": true,
"ParentId": null,
"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 location id.

Retrieve List

Request

URI

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

Allowable querystring parameters

Parameter

Description

columns

Comma-separated list of properties to return.

number

Filter by location number.

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

Location number.

Description

string

Location description.

StockpointId

guid

Stockpoint id.

Stockpoint

boolean

Whether this location is a stockpoint.

ParentId

guid

Parent location id.

BarCode

string

Bar code.

Phone

string

Phone number.

Phone2

string

Secondary phone number.

Notes

string

Free-form notes.

Address

string

Street address.

Address2

string

Second address line.

State

string

State.

Zip

string

Zip code.

City

string

City.

Country

string

Country.

DecommissionDate

date

Decommission date.

CostCenterId

guid

Associated cost center id.

CostCodeId

guid

Associated cost code id.

Inactive

boolean

Whether the location is inactive.

Example response body:

[
{
"Id": "d39da4c3-b42f-4d40-838c-35def0ca9789",
"Number": "s89sdfjh39",
"Description": "Main Warehouse",
"StockpointId": "d39da4c3-b42f-4d40-838c-35def0ca9789",
"Stockpoint": true,
"ParentId": null,
"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"}

Update

Request

URI

https://api.{cluster}.toolwatch.net/locations/{id}

Http Method

PUT

Headers

Authorization: {token}

Request Body

Supply the model completely. Any property that is omitted is overwritten with its default value.

Field

Type

Required

Description

Number

string

Yes

Location number. Max 10 characters.

Description

string

Yes

Location description. Max 50 characters.

StockpointId

guid

Yes

Stockpoint the location belongs to.

Stockpoint

boolean

No

Whether this location is a stockpoint.

ParentId

guid

Yes

Parent location id.

BarCode

string

No

Bar code.

Phone

string

No

Phone number.

Phone2

string

No

Secondary phone number.

Notes

string

No

Free-form notes.

Address

string

No

Street address.

Address2

string

No

Second address line.

State

string

No

State.

Zip

string

No

Zip code.

City

string

No

City.

Country

string

No

Country.

DecommissionDate

date

No

Decommission date.

CostCenterId

guid

No

Associated cost center id.

CostCodeId

guid

No

Associated cost code id.

Inactive

boolean

No

Whether the location is inactive.

Response

200 Ok

400 Bad Request

Triggered when field level validation fails.

Response body will contain validation message

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

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 location id.
Did this answer your question?