TABLE OF CONTENTS
Release Versions
Version | Description | Author | Release Date |
1.0 | Get Asset route API | Renuka Agrawal | 9/9/2024 |
API
Xemelgo APIs are primarily GRAPH QL APIs.
Login API
To access the Graph QL APIs users need to first access the Xemelgo login REST API to authenticate their credentials and then use the token to access the Graph QL APIs.
Rest API
- URL: rest.api.xemelgo.com/login
- Method: POST
Properties
Property | Type | Description | Required |
email | String | base64 Encoded email id for user | Yes |
password | String | base64 encoded password for user password needs to be a minimum of 8 characters and should have a number in it | Yes |
Request Body
{ "email": String, "password": String }
StatusCode - 200 on success
Response Body
{ "AccessToken": $accessToken, "ExpiresIn": $expiresIn, "TokenType": "Bearer", "RefreshToken": $refreshToken, "IdToken": $idToken }
Errors
Error | Error Code | Exception |
Incorrect username and or password | 400 | NotAuthorizedException |
Get Asset Route API
List Assets API allows to retrieve all the assets and view their statuses. It also allows to filter the list of APIs based on different properties
Graph API
- URL: api.xemelgo.com/graphql
- Method: POST
Input Properties
Property | Type | Description | Required |
id | String | Asset Number | Yes |
startDate | AWSTimestamp | Start date for route | No |
endDate | AWSTimestamp | End date for route | No |
Response Properties
Property | Type | Description | Required |
state | String | Current State of Asset at location i.e. unhand, removed | Yes |
startDate | AWSTimestamp | First detection timestamp at that location | No |
endDate | AWSTimestamp | Last detection timestamp at that location | No |
location | Object | Location at which the asset was last seen at (view table below) | No |
duration | Number | Time spent at that location | No |
Location
Property | Type | Description | Required |
id | String | Location identifier | Yes |
name | String | Location Name | No |
Headers
Header | Value | Notes |
Authorization | $accessToken | Use the acessToken from the response of the Login API |
Request Body
query assetRoute($id: String!, $startDate: AWSTimestamp, $endDate: AWSTimestamp, $nextToken: String) { assetRoute(input: { id: $id, startDate: $startDate, endDate: $endDate, nextToken: $nextToken }) { route { location { id name } state startDate endDate duration } } }
Response Body
{ "data": { "assetRoute": { "route": [ { "location": { "id": "LU3000EX", "name": "LU3000EX" }, "state": "onhand", "startDate": 1719864278922, "endDate": 1719864496290, "duration": 217368 }, { "location": { "id": "Server Room", "name": "Server Room" }, "state": "onhand", "startDate": 1719864496290, "endDate": 1719864827571, "duration": 331281 }, { "location": { "id": "LU3000EX", "name": "LU3000EX" }, "state": "onhand", "startDate": 1719864827571, "endDate": 1719866988210, "duration": 2160639 }, { "location": { "id": "Office", "name": "Office" }, "state": "onhand", "startDate": 1719866988210, "endDate": 1719867246015, "duration": 257805 }, { "location": { "id": "LU3000EX", "name": "LU3000EX" }, "state": "onhand", "startDate": 1719867246015, "endDate": 1719867531089, "duration": 285074 }, { "location": { "id": "Server Room", "name": "Server Room" }, "state": "onhand", "startDate": 1719867531089, "endDate": 1719867581293, "duration": 50204 }, { "location": { "id": "Office", "name": "Office" }, "state": "onhand", "startDate": 1719867581293, "endDate": 1719867614996, "duration": 33703 }, { "location": { "id": "LU3000EX", "name": "LU3000EX" }, "state": "onhand", "startDate": 1719867614996, "endDate": null, "duration": 3122990 } ] } } }
Errors
Error | Error Code | Error Type | Error Category |
Expired Token | 401 | UnauthorizedException | Authorization Error |
Invalid Token | 401 | UnauthorizedException | Authorization Error |
Missing Authorization Header | 401 | UnauthorizedException | Authorization Error |
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article