Internal Zone Downloading API
Use the Zone Downloading API to:
- Get zone download status
- Get zone download request
- Create zone download request
HTTP Headers
The HTTP headers are used to access all RTLS APIs are listed below. Before submitting requests to the company API, set the following headers.
| Header Name | Example Value | Description |
|---|---|---|
| X-User-Email | admin@example.com | Email of the user performing HTTP requests to the API. |
| X-User-Token | Drv3yU7PdyqUMtr89erZ | Token allowing user access to the API. |
NOTE: Headers are applying to public routes, routes starts with /api/private/... access from localhost and do not
require headers
Set header X-USER-EMAIL
Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the email
address returned in the response, set: X-USER-EMAIL = data.email
Set header X-USER-TOKEN
Send a request to log in using POST api/auth/log_in.json described in the Auth API. Using the
authentication token returned in the response, set: X-USER-TOKEN = data.token
Set header X-USER-PROJECT
Send a request to get projects using GET api/projects/ described in the Projects API.
You must send this request with headers X-USER-EMAIL and X-USER-TOKEN already set. Using the project UID returned in
the response, set:
X-USER-PROJECT = projects[i].uid
Zone Downloading Endpoints
| Functionality | Method | Endpoint |
|---|---|---|
| get zone download status | GET | /api/v2/zone_download_status |
| get zone download request | GET | /api/v2/zone_download_request/last_transaction |
| create zone download request | POST | /api/v2/zone_download_request |
Endpoints
Get zone download status
GET /api/v2/zone_download_status
- Headers:
- X-User-Project
- X-User-Email
- X-User-Token
Response fields
| Field | Description |
|---|---|
| zone_download_status | Array of trackable statuses |
| zone_download_status[].trackable_uid | Trackable unique id |
| zone_download_status[].download_status | Download status
|
| zone_download_status[].ts | ISO 8601 Date format |
| zone_download_status[].reason | |
| zone_download_status[].sync_requested |
Example Response
{
"zone_download_status": [
{
"trackable_uid": "XuwnyyXQTImMBgiX2qnn4Q",
"download_status": "OUTDATED",
"ts": "2023-12-14T14:28:26.559Z",
"reason": null,
"sync_requested": 0
},
{
"trackable_uid": "77JLs7lbQ8yqoSprKUcG2A",
"download_status": "OUTDATED",
"ts": "2023-12-14T14:35:32.942Z",
"reason": null,
"sync_requested": 0
}
]
}
Get zone download request
GET /api/v2/zone_download_request/last_transaction
- Headers:
- X-User-Project
- X-User-Email
- X-User-Token
Response Fields
| Field | Description |
|---|---|
| zone_download_transaction | Last transaction |
| zone_download_transaction.id | Transaction id |
| zone_download_transaction.uid | Transaction unique id |
| zone_download_transaction.trackable_uids | Transaction trackable unique id |
| zone_download_transaction.project_uid | Project unique id |
| zone_download_transaction.created_at | ISO 8601 Date format |
Example Response
{
"zone_download_transaction": {
"id": 24,
"uid": "6-BK2BGVRxaijLcNqH6deA",
"trackable_uids": "Aw_WW9XCRoanLKmx6lQVIA",
"project_uid": "2Ydhpw6GT8erwol2mi1MGA",
"created_at": "2024-02-07T11:03:30.649Z"
}
}
Create zone download request
POST /api/v2/zone_download_request
- Headers:
- X-User-Project
- X-User-Email
- X-User-Token
- Content-Type:application/json
Request Fields
| Field | Required | Type | Description |
|---|---|---|---|
| zone_download_request | required | object | Transaction object |
| zone_download_request.action | required | string | Transaction action
|
| zone_download_request.trackables | required | array | List of trackable objects |
| zone_download_request.trackables[].trackable_uid | required | string | Trackable unique id to POST action |
Response fields
| Field | Description |
|---|---|
| message | String with action result status |
Example Request
{
"zone_download_request": {
"action": "UPDATE",
"trackables": [
{
"trackable_uid": "Aw_WW9XCRoanLKmx6lQVIA"
}
]
}
}
Example Response
{
"message": "The following entities were successfully processed: [Aw_WW9XCRoanLKmx6lQVIA]. "
}
Errors
| Error Status | Error Type | Error Body | Description |
|---|---|---|---|
| 422 | Validation Error | Project is not specified | Project is not specified |