Internal Trackables API

Use the Trackables API to:

  • Get trackable position from state
  • Get trackable association
  • Update trackable group

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

Trackables Endpoints

Functionality Method Endpoint
get trackable position from state GET /api/v2/trackable_objects/position_from_state/${trackableUid}
get trackable association GET /api/v2/trackable_objects_associations?start=${start}&end=${end}
update trackable group PUT /api/v2/trackable_objects/{trackable_uid}/groups?no_notify=true

Get trackable position from state

GET /api/v2/trackable_objects/position_from_state/${trackableUid}

  • Headers
    • X-User-Email
    • X-User-Token
    • X-User-Project

Response fields

Field Description
trackablePositionFromState
trackablePositionFromState.position Last position of trackable
trackablePositionFromState.position.x Trackable position x
trackablePositionFromState.position.y Trackable position y
trackablePositionFromState.position.z Trackable position z
trackablePositionFromState.sublocation_uid Trackable sublocation unique id
trackablePositionFromState.location_uid Trackable location unique id

Example Response

  • trackable has no last position
{
  "trackablePositionFromState": null
}
  • trackable has last position
{
  "trackablePositionFromState": {
    "position": {
      "x": 3800,
      "y": 3800,
      "z": 1000
    },
    "sublocation_uid": "IzuzW_tVRtiurTHWR9gFTA",
    "location_uid": "TR2DvImaTECmrMLqjvZHtQ"
  }
}

Get trackable association

Get active trackable association in time interval

GET /api/v2/track_assoc?start=${start}&end=${end} GET /api/v2/trackable_objects_associations?start=${start}&end=${end} GET /api/v2/trackable_objects_associations?start=1675599386&end=1707308431

  • Headers
    • X-User-Email
    • X-User-Token
    • X-User-Project

Request Query String Fields

Field Required Type Description
start required number unix format date second part
end required number unix format date second part

Response fields

Field Description
trackable_objects_associations Array of trackable object associations
trackable_objects_associations[].mac_address Association mac address
trackable_objects_associations[].trob_uid Association trackable unique id
trackable_objects_associations[].created_at ISO 8601 Date format when association created
trackable_objects_associations[].removed_at ISO 8601 Date format when association removed
trackable_objects_associations[].uid Association unique id
trackable_objects_associations[].project_uid Project unique id
trackable_objects_associations[].company_uid Company unique id
trackable_objects_associations[].obj_uid Association trackable unique id

Example Response

{
  "trackable_objects_associations": [
    {
      "mac_address": "e4956ea00002",
      "trob_uid": "KTt7Q_B0Twa6TE6jRic_gA",
      "created_at": "2023-11-07T20:03:05.000Z",
      "removed_at": "9999-12-31T23:59:59.000Z",
      "uid": "fYZERvZCTHuNW9G4i0_seA",
      "project_uid": "2Ydhpw6GT8erwol2mi1MGA",
      "company_uid": "aG24p4lDRfSQLtOVPYiKsA",
      "obj_uid": "KTt7Q_B0Twa6TE6jRic_gA"
    },
    {
      "mac_address": "e4956ea00001",
      "trob_uid": "sae7jlpNTMyiDzocFGX8UQ",
      "created_at": "2023-11-07T20:03:01.000Z",
      "removed_at": "9999-12-31T23:59:59.000Z",
      "uid": "gucCQi9hRsCE8U8_memQnQ",
      "project_uid": "2Ydhpw6GT8erwol2mi1MGA",
      "company_uid": "aG24p4lDRfSQLtOVPYiKsA",
      "obj_uid": "sae7jlpNTMyiDzocFGX8UQ"
    },
    {
      "mac_address": "999999900000",
      "trob_uid": "SWrWByOyTNmVhhWSfIf32A",
      "created_at": "2024-02-07T12:19:58.000Z",
      "removed_at": "2024-02-07T12:20:07.000Z",
      "uid": "qGNt_W13QHyVdlhjo12Ntg",
      "project_uid": "2Ydhpw6GT8erwol2mi1MGA",
      "company_uid": "aG24p4lDRfSQLtOVPYiKsA",
      "obj_uid": "SWrWByOyTNmVhhWSfIf32A"
    },
    {
      "mac_address": "e4956ea00003",
      "trob_uid": "Aw_WW9XCRoanLKmx6lQVIA",
      "created_at": "2023-11-07T20:03:09.000Z",
      "removed_at": "9999-12-31T23:59:59.000Z",
      "uid": "Zymo4rCrSridsquVY7tFgQ",
      "project_uid": "2Ydhpw6GT8erwol2mi1MGA",
      "company_uid": "aG24p4lDRfSQLtOVPYiKsA",
      "obj_uid": "Aw_WW9XCRoanLKmx6lQVIA"
    }
  ]
}

Errors

Error Status Error Type Error Body Description
422 Validation Error { "end": "The \"end\" parameter could not be empty"} end field must be specify
422 Validation Error { "start": "The \"start\" parameter could not be empty"} start field must be specify
422 Validation Error { "dates": "The \"end\" should be greater then \"start\" date"} end date must be grater than start

Update trackable group

PUT /api/v2/trackable_objects/{trackable_uid}/groups?no_notify=true

  • Headers
    • X-User-Email
    • X-User-Token
    • X-User-Project

Assign groups to trackable.

Request Fields

Field Description
[] Array of group unique ids

Example Response

Assign groups with "Aw_WW9XCRoanLKmx6lQVuq" and "Dddhsw6qT8FrwDl2mQ1MGA" to trackable

[
  "Aw_WW9XCRoanLKmx6lQVuq",
  "Dddhsw6qT8FrwDl2mQ1MGA"
]

Response

Status 204

results matching ""

    No results matching ""