Asset types

An asset type is a subset of an asset group. Use the API to retrieve a list of all asset types, add or update, or delete an asset type.

Learn more about assets in the OnLocation Help Center.

List asset types

Returns a list of asset types.

Request
query Parameters
q
string <string>

Filter by any asset type value.

Example: q=name:macbooks,description:anydescriptions
limit
integer <int32>

Limits the amount of records to return (maxiumum 5000).

Example: limit=10
Responses
200

List of asset types

403

Access denied to this resource

404

Resource not found

get/assettype
Request samples
curl -i -X GET \
  'https://api.whosonlocation.com/v1/assettype?q=string&limit=0'
Response samples
[
  • {
    }
]

Create an asset type

Creates a new asset type that can be assigned to an asset.

Request
Request Body schema: application/json

Information to use when creating a new asset type record.

name
string <string>

Name of the asset type

group_id
integer <int32>

Group ID of the asset type.

description
string or null <string>

Description of the asset type

Responses
201

Asset Type created

403

Access denied to this resource

500

Internal server error

post/assettype
Request samples
application/json
{
  • "name": "Macbooks",
  • "group_id": "10008",
  • "description": "A portable device type"
}
Response samples
application/json
{
  • "id": "10008",
  • "name": "Laptop",
  • "group_id": "20000",
  • "description": "A portable device type"
}

Retrieve an asset type

Retrieves a single asset type, filtering with the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the asset type to retrieve

Responses
200
403

Access denied to resource

404

Resource not found

500

Internal server error

get/assettype/{id}
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/assettype/:id
Response samples
{
  • "id": "10008",
  • "name": "Laptop",
  • "group_id": "20000",
  • "description": "A portable device type"
}

Update an asset type

Updates the details of an asset type.

Request
path Parameters
id
required
integer <int32>

ID of the asset type to update

Request Body schema: application/json

Information used to update the asset type record

name
string <string>

Name of the asset type

group_id
integer <int32>

Group ID of the asset type.

description
string or null <string>

Description of the asset type

Responses
200

Updated resource

403

Access denied to this resource

404

Resource not found

500

Internal server error

put/assettype/{id}
Request samples
application/json
{
  • "name": "Macbooks",
  • "group_id": "10008",
  • "description": "A portable device type"
}
Response samples
{
  • "id": "10008",
  • "name": "Laptop",
  • "group_id": "20000",
  • "description": "A portable device type"
}

Delete an asset type

Deletes an asset type using the provided ID.

Request
path Parameters
id
required
integer <int32>

ID of the asset type to delete

Responses
204

Asset Type deleted

403

Access denied to resource

404

Resource not found

500

Internal server error

delete/assettype/{id}
Request samples
curl -i -X DELETE \
  https://api.whosonlocation.com/v1/assettype/:id