Assets

Manage your organization’s assets with OnLocation. Use the API to retrieve a list of assets, add or update, or delete an asset, or issue or return an asset. Your account owner must first enable the add-on in OnLocation.

Learn more about assets in the OnLocation Help Center.

List assets

Returns a list of assets.

Request
query Parameters
q
string <string>

Filter by any asset value.

Example: q=name:iPhone4
limit
integer <int32>

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

Example: limit=10
Responses
200

List of assets

400

Invalid Input

403

Access denied to this resource

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

Create an asset

Creates a new asset with the provided details.

Request
Request Body schema: application/json

Information used to create a new asset record

type_id
integer <int32>

Type ID of the asset

name
string <string>

Name of the asset

tag
string <string>

Tag of the asset

reference
string <string>

Reference of the asset

department_id
integer <int32>

Department ID of the asset

notes
string <string>

Notes for the asset

geo_lat
string <string>

Geolocation latitude of the asset

geo_lon
string <string>

Geolocation longitude of the asset

owner_type
string
Enum: "org" "sp"
owner_staff_id
integer <int32>

Asset owner staff ID, should only be set if owner_type is 'org'

owner_sp_id
integer <int32>

Asset owner contractor ID, should only be set if owner_type is 'sp'

location_id
integer <int32>

Location ID of the asset

Responses
201

Created resource

400

Invalid input

403

Access denied to this resource

500

Internal server error

post/asset
Request samples
application/json
{
  • "type_id": 1,
  • "name": "Laptop 001",
  • "tag": "TAG001",
  • "reference": "REF001",
  • "department_id": 1,
  • "notes": "Notes about the asset",
  • "geo_lat": "12.34",
  • "geo_lon": "56.78",
  • "owner_type": "org",
  • "owner_staff_id": 1583,
  • "owner_sp_id": 2700,
  • "location_id": 1
}
Response samples
{
  • "id": 1,
  • "type_id": 1,
  • "name": "Laptop 001",
  • "tag": "TAG001",
  • "reference": "REF001",
  • "department_id": 1,
  • "notes": "Notes about the asset",
  • "geo_lat": "12.34",
  • "geo_lon": "56.78",
  • "owner_type": "org",
  • "owner_staff_id": 1,
  • "owner_sp_id": 1,
  • "location_id": 1,
  • "status": "in"
}

Retrieve an asset

Retrieves an asset by its ID.

Request
path Parameters
id
required
integer

ID of the asset to retrieve

Responses
200

Asset found

403

Access denied to this resource

404

Asset not found

500

Internal server error

get/asset/{id}
Request samples
curl -i -X GET \
  https://api.whosonlocation.com/v1/asset/:id
Response samples
{
  • "id": 1,
  • "type_id": 1,
  • "name": "Laptop 001",
  • "tag": "TAG001",
  • "reference": "REF001",
  • "department_id": 1,
  • "notes": "Notes about the asset",
  • "geo_lat": "12.34",
  • "geo_lon": "56.78",
  • "owner_type": "org",
  • "owner_staff_id": 1,
  • "owner_sp_id": 1,
  • "location_id": 1,
  • "status": "in"
}

Update an asset

Updates the details of an asset.

Request
path Parameters
id
required
integer <int32>

ID of the asset to update

Request Body schema: application/json

Information used to update the asset record

type_id
integer <int32>

Type ID of the asset

name
string <string>

Name of the asset

tag
string <string>

Tag of the asset

reference
string <string>

Reference of the asset

department_id
integer <int32>

Department ID of the asset

notes
string <string>

Notes for the asset

geo_lat
string <string>

Geolocation latitude of the asset

geo_lon
string <string>

Geolocation longitude of the asset

owner_type
string
Enum: "org" "sp"
owner_staff_id
integer <int32>

Asset owner staff ID, should only be set if owner_type is 'org'

owner_sp_id
integer <int32>

Asset owner contractor ID, should only be set if owner_type is 'sp'

location_id
integer <int32>

Location ID of the asset

Responses
200

Updated resource

400

Invalid Input

403

Access denied to this resource

404

Resource not found

500

Internal server error

put/asset/{id}
Request samples
application/json
{
  • "type_id": 1,
  • "name": "Laptop 001",
  • "tag": "TAG001",
  • "reference": "REF001",
  • "department_id": 1,
  • "notes": "Notes about the asset",
  • "geo_lat": "12.34",
  • "geo_lon": "56.78",
  • "owner_type": "org",
  • "owner_staff_id": 1583,
  • "owner_sp_id": 2700,
  • "location_id": 1
}
Response samples
{
  • "id": 1,
  • "type_id": 1,
  • "name": "Laptop 001",
  • "tag": "TAG001",
  • "reference": "REF001",
  • "department_id": 1,
  • "notes": "Notes about the asset",
  • "geo_lat": "12.34",
  • "geo_lon": "56.78",
  • "owner_type": "org",
  • "owner_staff_id": 1,
  • "owner_sp_id": 1,
  • "location_id": 1,
  • "status": "in"
}

Delete an asset

Deletes an asset by its ID.

Request
path Parameters
id
required
integer

ID of the asset to delete

Responses
204

Asset deleted successfully

400

Invalid input

403

Access denied to this resource

404

Asset not found

500

Internal server error

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

Issue an asset

Issue an asset with the provided details, this will create a new asset movement.

Request
path Parameters
id
required
integer <int32>

Asset ID

Request Body schema: application/json

Information used to issue an asset

assigned_type
string <string>

Type of the entity to whom the asset is being assigned

Enum: "staff" "spm" "visitor"
assigned_staff_id
integer <int32>

ID of the staff to whom the asset is being assigned, should only be set if assigned_type is 'staff'

assigned_spm_id
integer <int32>

ID of the contractor member to whom the asset is being assigned, should only be set if assigned_type is 'spm'

assigned_visitor_id
integer <int32>

ID of the visitor to whom the asset is being assigned, should only be set if assigned_type is 'visitor'

dueback
string <date-time>

Dueback date for the asset

Responses
200

Issued successfully

400

Invalid input

403

Access denied to this resource

500

Internal server error

put/asset/{id}/issue
Request samples
application/json
{
  • "assigned_type": "staff",
  • "assigned_staff_id": 1,
  • "assigned_spm_id": 1,
  • "assigned_visitor_id": 1,
  • "dueback": "2023-05-01 13:10:00"
}
Response samples
{
  • "asset_id": 1,
  • "assigned_type": "staff",
  • "assigned_staff_id": 1,
  • "assigned_spm_id": 1,
  • "assigned_visitor_id": 1,
  • "signed_out": "2023-04-18 13:15:00",
  • "signed_in": "2023-04-18 13:15:00",
  • "dueback": "2023-05-01 13:15:07",
  • "notes": "Notes about the asset movement",
  • "issued_out": "10008",
  • "issued_in": "20008"
}

Return an asset

Return an asset with the provided details.

Request
path Parameters
id
required
integer <int32>

Asset ID

Responses
200

Returned successfully

400

Invalid input

403

Access denied to this resource

500

Internal server error

put/asset/{id}/return
Request samples
curl -i -X PUT \
  https://api.whosonlocation.com/v1/asset/:id/return
Response samples
{
  • "asset_id": 1,
  • "assigned_type": "staff",
  • "assigned_staff_id": 1,
  • "assigned_spm_id": 1,
  • "assigned_visitor_id": 1,
  • "signed_out": "2023-04-18 13:15:00",
  • "signed_in": "2023-04-18 13:15:00",
  • "dueback": "2023-05-01 13:15:07",
  • "notes": "Notes about the asset movement",
  • "issued_out": "10008",
  • "issued_in": "20008"
}