Managing, updating & keeping track of user relationships in the Locomote Corporate Travel Platform is a full-time job. Users come & go, roles change and evolve and the world keeps on turning. With the API we can easily identify the specific Authorisers (both single & mutli-level), Risk Authorisers, Travel Arrangers & Employee Groups tied to an individual profile (User.)
User Assignments ie. Authorisers can be updated at a company level by the company administrator, or they can be managed by the allocated Travel Arranger. Authorisers do not have the permissions required to change a user profile, unless that Authoriser is also an administrator and/or Travel Arranger.
Using the Profile (JSON) API, we can retrieve a list of assignments for a specific user (using the work_employee_id) via the GET function. When specifying a relationship to profile, PATCH & DELETE options are available for the relationship.
We cannot create (POST) an assignment, however we can create the resource first and then using PATCH, link that resource to a user.
Secured by auth_token.
Authorisation via "X-USER-USERNAME" and "X-USER-TOKEN"
Authorisers
Get assigned Authorisers
Returns all "authorisers" resources belonging to a "users" resource.
GET https://locomotetmp.com/api/users/{work_employee_id}/authorisers
Request Parameters
Parameter Name | Description | Required | Valid Values |
page[number] | The page number to fetch | No | Any Integer |
page[size] | The number of items that appear on each page | No | Any Integer |
Remember
If no Authoriser is assigned to a profile, then no data will be returned in the response.
Example Request
curl -i -H X-USER_TOKEN\:\ [your API key] -H X-USER-USERNAME\:\ [Company Admin email] -H Content-Type\:\ application/json -XGET https\://[your subdomain].locomotetmp.com/api/users/{work_employee_id}/authorisers
No request fields required for GET
Example Response
Status Code: 200 - OK
{ "data": [ { "id": "098765", "type": "users", "attributes": { "email": "traveller.john@profile.com", "title": "Mr", "first_name": "John", "last_name": "Smith", "work_employee_id": "098765" } }, { "id": "000111", "type": "users", "attributes": { "email": "vanessa.risk@profile.com", "title": "Miss", "first_name": "Vanessa", "last_name": "Jones", "work_employee_id": "000111" } } ],
Response Fields
Field Name | Description | Valid Values |
| Identifier used to reference a given record | Read only |
| Type of resource | users |
| User's email address | Any valid email address |
| User's preferred title | Mr, Mrs, Ms, Master, Miss, Dr, Admiral, Ambassador, Captain, Father, Honorable, Judge, Justice, Lady, Lord, Madam, Prof, Rabbi, Reverend, Senator, Sergeant, Sheikh, Sheikha, Sir, Sister |
| User's first name | Character length: <= 50 |
| User's surname | Character length: <= 50 |
| Identifier a company uses to reference a given employee | Character length: <=50, |
To update (PATCH) or remove (DELETE) Authoriser assignments, please refer to this article.
First Level Authorisers
Get assigned First Level Authorisers
Returns all "first_level_authorisers" resources belonging to a "users" resource.
GET https://locomotetmp.com/api/users/{work_employee_id}/first_level_authorisers
Request Parameters
Parameter Name | Description | Required | Valid Values |
page[number] | The page number to fetch | No | Any Integer |
page[size] | The number of items that appear on each page | No | Any Integer |
Remember
If no First Level Authoriser is assigned to a profile, then no data will be returned in the response.
Example Request
curl -i -H X-USER_TOKEN\:\ [your API key] -H X-USER-USERNAME\:\ [Company Admin email] -H Content-Type\:\ application/json -XGET https\://[your subdomain].locomotetmp.com/api/users/{work_employee_id}/first_level_authorisers
No request fields required for GET
Example Response
Status Code: 200 - OK
{ "data": [ { "id": "123456", "type": "users", "attributes": { "email": "authoriser.first@profile.com", "title": "Mr", "first_name": "Jack", "last_name": "Ovaltrades", "work_employee_id": "123456" } }, { "id": "222444", "type": "users", "attributes": { "email": "steve.arranger@profile.com", "title": "Dr", "first_name": "Steve", "last_name": "Arranger", "work_employee_id": "222444" } } ],
Response Fields
Field Name | Description | Valid Values |
| Identifier used to reference a given record | Read only |
| Type of resource | users |
| User's email address | Any valid email address |
| User's preferred title | Mr, Mrs, Ms, Master, Miss, Dr, Admiral, Ambassador, Captain, Father, Honorable, Judge, Justice, Lady, Lord, Madam, Prof, Rabbi, Reverend, Senator, Sergeant, Sheikh, Sheikha, Sir, Sister |
| User's first name | Character length: <= 50 |
| User's surname | Character length: <= 50 |
| Identifier a company uses to reference a given employee | Character length: <=50, |
To update (PATCH) or remove (DELETE) First Level Authoriser assignments, please refer to this article.
Second Level Authorisers
Get assigned Second Level Authorisers
Returns all "second_level_authorisers" resources belonging to a "users" resource.
GET https://locomotetmp.com/api/users/{work_employee_id}/second_level_authorisers
Request Parameters
Parameter Name | Description | Required | Valid Values |
page[number] | The page number to fetch | No | Any Integer |
page[size] | The number of items that appear on each page | No | Any Integer |
Remember
If no Second Level Authoriser is assigned to a profile, then no data will be returned in the response.
Example Request
curl -i -H X-USER_TOKEN\:\ [your API key] -H X-USER-USERNAME\:\ [Company Admin email] -H Content-Type\:\ application/json -XGET https\://[your subdomain].locomotetmp.com/api/users/{work_employee_id}/second_level_authorisers
No request fields required for GET
Example Response
Status Code: 200 - OK
{ "data": [ { "id": "098765", "type": "users", "attributes": { "email": "traveller.john@profile.com", "title": "Mr", "first_name": "John", "last_name": "Smith", "work_employee_id": "098765" } } ],
Response Fields
Field Name | Description | Valid Values |
| Identifier used to reference a given record | Read only |
| Type of resource | users |
| User's email address | Any valid email address |
| User's preferred title | Mr, Mrs, Ms, Master, Miss, Dr, Admiral, Ambassador, Captain, Father, Honorable, Judge, Justice, Lady, Lord, Madam, Prof, Rabbi, Reverend, Senator, Sergeant, Sheikh, Sheikha, Sir, Sister |
| User's first name | Character length: <= 50 |
| User's surname | Character length: <= 50 |
| Identifier a company uses to reference a given employee | Character length: <=50, |
To update (PATCH) or remove (DELETE) Second Level Authoriser assignments, please refer to this article.
Risk Authorisers
Get assigned Risk Authorisers
Returns all "risk_authorisers" resources belonging to a "users" resource.
GET https://locomotetmp.com/api/users/{work_employee_id}/risk_authorisers
Request Parameters
Parameter Name | Description | Required | Valid Values |
page[number] | The page number to fetch | No | Any Integer |
page[size] | The number of items that appear on each page | No | Any Integer |
Remember
If no Risk Authoriser is assigned to a profile, then no data will be returned in the response.
Example Request
curl -i -H X-USER_TOKEN\:\ [your API key] -H X-USER-USERNAME\:\ [Company Admin email] -H Content-Type\:\ application/json -XGET https\://[your subdomain].locomotetmp.com/api/users/{work_employee_id}/risk_authorisers
No request fields required for GET
Example Response
Status Code: 200 - OK
{ "data": [ { "id": "222444", "type": "users", "attributes": { "email": "steve.risk@profile.com", "title": "Dr", "first_name": "Steve", "last_name": "Risk", "work_employee_id": "222444" } } ],
Response Fields
Field Name | Description | Valid Values |
| Identifier used to reference a given record | Read only |
| Type of resource | users |
| User's email address | Any valid email address |
| User's preferred title | Mr, Mrs, Ms, Master, Miss, Dr, Admiral, Ambassador, Captain, Father, Honorable, Judge, Justice, Lady, Lord, Madam, Prof, Rabbi, Reverend, Senator, Sergeant, Sheikh, Sheikha, Sir, Sister |
| User's first name | Character length: <= 50 |
| User's surname | Character length: <= 50 |
| Identifier a company uses to reference a given employee | Character length: <=50, |
To update (PATCH) or remove (DELETE) Risk Authoriser assignments, please refer to this article.
Travel Arrangers
Get assigned Travel Arrangers
Returns all "travel_arrangers" resources belonging to a "users" resource.
GET https://locomotetmp.com/api/users/{work_employee_id}/travel_arrangers
Request Parameters
Parameter Name | Description | Required | Valid Values |
page[number] | The page number to fetch | No | Any Integer |
page[size] | The number of items that appear on each page | No | Any Integer |
Remember
If no Travel Arranger is assigned to a profile, then no data will be returned in the response.
Example Request
curl -i -H X-USER_TOKEN\:\ [your API key] -H X-USER-USERNAME\:\ [Company Admin email] -H Content-Type\:\ application/json -XGET https\://[your subdomain].locomotetmp.com/api/users/{work_employee_id}/travel_arrangers
No request fields required for GET
Example Response
Status Code: 200 - OK
{ "data": [ { "id": "000111", "type": "users", "attributes": { "email": "vanessa.risk@profile.com", "title": "Miss", "first_name": "Vanessa", "last_name": "Jones", "work_employee_id": "000111" } }, { "id": "222444", "type": "users", "attributes": { "email": "steve.arranger@profile.com", "title": "Dr", "first_name": "Steve", "last_name": "Arranger", "work_employee_id": "222444" } } ],
Response Fields
Field Name | Description | Valid Values |
| Identifier used to reference a given record | Read only |
| Type of resource | users |
| User's email address | Any valid email address |
| User's preferred title | Mr, Mrs, Ms, Master, Miss, Dr, Admiral, Ambassador, Captain, Father, Honorable, Judge, Justice, Lady, Lord, Madam, Prof, Rabbi, Reverend, Senator, Sergeant, Sheikh, Sheikha, Sir, Sister |
| User's first name | Character length: <= 50 |
| User's surname | Character length: <= 50 |
| Identifier a company uses to reference a given employee | Character length: <=50, |
To update (PATCH) or remove (DELETE) Travel Arranger assignments, please refer to this article.
Employee Groups
Get assigned Employee Groups
Returns all "employee_groups" resources belonging to a "users" resource.
GET https://locomotetmp.com/api/users/{work_employee_id}/employee_groups
Request Parameters
Parameter Name | Description | Required | Valid Values |
page[number] | The page number to fetch | No | Any Integer |
page[size] | The number of items that appear on each page | No | Any Integer |
Remember
If no Employee Group is assigned to a profile, then no data will be returned in the response.
Example Request
curl -i -H X-USER_TOKEN\:\ [your API key] -H X-USER-USERNAME\:\ [Company Admin email] -H Content-Type\:\ application/json -XGET https\://[your subdomain].locomotetmp.com/api/users/{work_employee_id}/employee_groups
No request fields required for GET
Example Response
Status Code: 200 - OK
{ "data": [ { "id": "IT", "type": "employee_groups", "attributes": { "code": "IT", "name": "IT Team" }, "relationships": { "role_filter": { "data": { "id": "traveller", "type": "roles" } } } } ],
Response Fields
Field Name | Description | Valid Values |
| Identifier used to reference a given record | Read only |
| Type of resource | users |
| User's email address | Any valid email address |
| User's preferred title | Mr, Mrs, Ms, Master, Miss, Dr, Admiral, Ambassador, Captain, Father, Honorable, Judge, Justice, Lady, Lord, Madam, Prof, Rabbi, Reverend, Senator, Sergeant, Sheikh, Sheikha, Sir, Sister |
| User's first name | Character length: <= 50 |
| User's surname | Character length: <= 50 |
| Identifier a company uses to reference a given employee | Character length: <=50, |
To update (PATCH) or remove (DELETE) Employee Groups assignments, please refer to this article.
Troubleshooting
If you got a response code other than the code listed in the article, please refer to this page.