Each employee has a profile in OnLocation. It contains their name, contact information, locations, department, user roles and role types, and tokens.
Use the employee API to return a list of all employees, add, update or delete employees, retrieve photos, and sign employees in or out.We recommend that bulk employee changes are managed using our SyncPortal integration rather than the API. Check the OnLocation Help Center for more information.
Retrieves a list of all employees.
A comma separated list of tag:value search parameters, a colon separator performs an exact match, a percent separator performs a starts-with search and greater/less than search number/date ranges.
A person can be matched to an external token which has been assigned to their profile such as RFID card number, a security turnstile controller may search for a staff account to update the onsite status, eg q=token:C1BB7F.
List of employees
Access denied to this resource
Resource not found
Internal server error
curl -i -X GET \ 'https://api.whosonlocation.com/v1/staff?q=string&order=string&limit=0' \ -H 'If-Modified-Since: string'
[- {
- "id": 823562,
- "created": "2021-10-06T15:35:50+13:00",
- "modified": "2021-10-06T16:35:50+13:00",
- "account_status": "new",
- "last_login": "2021-11-15T16:35:50+13:00",
- "onsite_status": "offsite",
- "name": "Staff Name",
- "title": "Mr",
- "altname": "Daffy",
- "email": "john.doe@example.org",
- "phone": "+1 206 555 0123",
- "mobile": "+1 206 555 0123",
- "ice": "+1 206 555 0123",
- "setup_method": "manual",
- "employee_id": "1005",
- "location": "Head Office",
- "cur_location": "Head Office",
- "department": "Administration",
- "roles": [
- [
- "Safety Office",
- "Fire Warden"
]
], - "role_types": [
- [
- "Non-Host",
- "Safety Operator"
]
], - "tokens": [
- {
- "type": "string",
- "number": 0,
- "issued": "2019-08-24T14:15:22Z",
- "expiry": "2019-08-24T14:15:22Z"
}
], - "remote": 1,
- "customfields": {
- "123": "custom-field value"
}, - "globalroaming": 1,
- "globalroaming_locations": [
- {
- "id": 1,
- "name": "Head Office"
}
]
}
]
Updates a list of multiple employees.
The request body contains a bulk staff list which will be processed by OnLocation for adds/updates/deletes. Set the Content-Type header to identify the the format of the bulk data.
Tokens can be imported by supplying at least tokenXtype and tokenXnumber columns where X is a arbitrary number, ie token1type. Token issued and expires will only be imported if set, multiple tokens are designated by using a different number for each set.
Information used to update an employee or list of employees:
Updated employee record
Access denied to this resource
Internal server error
[- {
- "name": "Staff Name",
- "title": "Mr",
- "altname": "Daffy",
- "email": "example.staff@whosonlocation.com",
- "phone": "+1 206 555 0123",
- "mobile": "+1 206 555 0123",
- "ice": "+1 206 555 0123",
- "employee_id": 301,
- "onsite_status": "offsite",
- "location": "Head Office",
- "roletype": [
- [
- "Non-Host",
- "Safety Operator"
]
], - "customfields": [
- [
- "Deprecated, please use the cf-parameter instead"
]
], - "cf": {
- "123": "custom-field value"
}, - "globalroaming": 1,
- "globalroaming_locations": [
- [
- 1500,
- 3000,
- 2600
]
]
}
]
[- {
- "id": 823562,
- "created": "2021-10-06T15:35:50+13:00",
- "modified": "2021-10-06T16:35:50+13:00",
- "account_status": "new",
- "last_login": "2021-11-15T16:35:50+13:00",
- "onsite_status": "offsite",
- "name": "Staff Name",
- "title": "Mr",
- "altname": "Daffy",
- "email": "john.doe@example.org",
- "phone": "+1 206 555 0123",
- "mobile": "+1 206 555 0123",
- "ice": "+1 206 555 0123",
- "setup_method": "manual",
- "employee_id": "1005",
- "location": "Head Office",
- "cur_location": "Head Office",
- "department": "Administration",
- "roles": [
- [
- "Safety Office",
- "Fire Warden"
]
], - "role_types": [
- [
- "Non-Host",
- "Safety Operator"
]
], - "tokens": [
- {
- "type": "string",
- "number": 0,
- "issued": "2019-08-24T14:15:22Z",
- "expiry": "2019-08-24T14:15:22Z"
}
], - "remote": 1,
- "customfields": {
- "123": "custom-field value"
}, - "globalroaming": 1,
- "globalroaming_locations": [
- {
- "id": 1,
- "name": "Head Office"
}
]
}
]
Creates a new employee profile
Information used to create an employee:
Employee created
Access denied to this resource
Internal server error
{- "name": "Staff Name",
- "title": "Mr",
- "altname": "Daffy",
- "email": "example.staff@whosonlocation.com",
- "phone": "+1 206 555 0123",
- "mobile": "+1 206 555 0123",
- "ice": "+1 206 555 0123",
- "employee_id": 301,
- "onsite_status": "offsite",
- "location": "Head Office",
- "roletype": [
- [
- "Non-Host",
- "Safety Operator"
]
], - "customfields": [
- [
- "Deprecated, please use the cf-parameter instead"
]
], - "cf": {
- "123": "custom-field value"
}, - "globalroaming": 1,
- "globalroaming_locations": [
- [
- 1500,
- 3000,
- 2600
]
]
}
{- "id": 823562,
- "created": "2021-10-06T15:35:50+13:00",
- "modified": "2021-10-06T16:35:50+13:00",
- "account_status": "new",
- "last_login": "2021-11-15T16:35:50+13:00",
- "onsite_status": "offsite",
- "name": "Staff Name",
- "title": "Mr",
- "altname": "Daffy",
- "email": "john.doe@example.org",
- "phone": "+1 206 555 0123",
- "mobile": "+1 206 555 0123",
- "ice": "+1 206 555 0123",
- "setup_method": "manual",
- "employee_id": "1005",
- "location": "Head Office",
- "cur_location": "Head Office",
- "department": "Administration",
- "roles": [
- [
- "Safety Office",
- "Fire Warden"
]
], - "role_types": [
- [
- "Non-Host",
- "Safety Operator"
]
], - "tokens": [
- {
- "type": "string",
- "number": 0,
- "issued": "2019-08-24T14:15:22Z",
- "expiry": "2019-08-24T14:15:22Z"
}
], - "remote": 1,
- "customfields": {
- "123": "custom-field value"
}, - "globalroaming": 1,
- "globalroaming_locations": [
- {
- "id": 1,
- "name": "Head Office"
}
]
}
Retrieves an employee's image, filtering with the provided ID. The request body contains the binary image data in the format specified by the Content-Type header.
The employee's photo, if they have one
Access denied to resource
Resource not found
Internal server error
curl -i -X GET \ https://api.whosonlocation.com/v1/staff/:id/photo
Updates an employee profile image.
Updated photo
Access denied to this resource
Employee not found
Internal server error
curl -i -X PUT \ https://api.whosonlocation.com/v1/staff/:id/photo \ -H 'Content-Type: string'
Retrieves a single employee's profile image metadata.'
Employee profile image data
Access denied to resource
Resource not found
Internal server error
curl -i -X HEAD \ https://api.whosonlocation.com/v1/staff/:id/photo
Retrieves a single employee record, filtering with the provided ID.
A person can be matched to an external token which has been assigned to their profile such as RFID card number, a security turnstile controller may search for a staff account to update the onsite status, eg q=token:C1BB7F.
Employee matching the provided ID
Access denied to resource
Resource not found
Internal server error
curl -i -X GET \ https://api.whosonlocation.com/v1/staff/:id
{- "id": 823562,
- "created": "2021-10-06T15:35:50+13:00",
- "modified": "2021-10-06T16:35:50+13:00",
- "account_status": "new",
- "last_login": "2021-11-15T16:35:50+13:00",
- "onsite_status": "offsite",
- "name": "Staff Name",
- "title": "Mr",
- "altname": "Daffy",
- "email": "john.doe@example.org",
- "phone": "+1 206 555 0123",
- "mobile": "+1 206 555 0123",
- "ice": "+1 206 555 0123",
- "setup_method": "manual",
- "employee_id": "1005",
- "location": "Head Office",
- "cur_location": "Head Office",
- "department": "Administration",
- "roles": [
- [
- "Safety Office",
- "Fire Warden"
]
], - "role_types": [
- [
- "Non-Host",
- "Safety Operator"
]
], - "tokens": [
- {
- "type": "string",
- "number": 0,
- "issued": "2019-08-24T14:15:22Z",
- "expiry": "2019-08-24T14:15:22Z"
}
], - "remote": 1,
- "customfields": {
- "123": "custom-field value"
}, - "globalroaming": 1,
- "globalroaming_locations": [
- {
- "id": 1,
- "name": "Head Office"
}
]
}
Updates a one or more employee profiles.
Information used to update an employee or list of employees:
Updated employee record
Access denied to this resource
Internal server error
{- "name": "Staff Name",
- "title": "Mr",
- "altname": "Daffy",
- "email": "example.staff@whosonlocation.com",
- "phone": "+1 206 555 0123",
- "mobile": "+1 206 555 0123",
- "ice": "+1 206 555 0123",
- "employee_id": 301,
- "onsite_status": "offsite",
- "location": "Head Office",
- "roletype": [
- [
- "Non-Host",
- "Safety Operator"
]
], - "customfields": [
- [
- "Deprecated, please use the cf-parameter instead"
]
], - "cf": {
- "123": "custom-field value"
}, - "globalroaming": 1,
- "globalroaming_locations": [
- [
- 1500,
- 3000,
- 2600
]
]
}