Get Localization Data via REST API
Use the Twinzo REST API endpoint GET /v3/devices/locations to retrieve localization data for a device as a time-ordered list of recorded positions. This endpoint returns coordinates in the Twinzo sector coordinate system and is useful for tracking movement history, validating incoming localization, or integrating position data into external systems.
This page describes how to read localization data. If you need to send localization data into Twinzo, see Localization Data.
Endpoint overview
Method:
GETPath:
/v3/devices/locationsResponse: JSON array of location records
Localization works for registered devices. Coordinates are tied to the configured sector and must be interpreted using the Twinzo coordinate system for that sector.
What the endpoint returns
The API returns a list of location samples. Each object represents one recorded position of the device at a specific time.
[
{
"Timestamp": 1782381265588,
"SectorId": 1,
"Interval": 1000,
"X": 1000,
"Y": 1000
},
{
"Timestamp": 1782381265588,
"SectorId": 1,
"Interval": 1000,
"X": 1370,
"Y": 1000
}
]In this example, the response contains two position records in the same sector. The second record shows movement on the X axis from 1000 to 1370, while the Y position remains unchanged at 1000.
Field reference
Field | Type | Description |
|---|---|---|
| integer | Unix timestamp in milliseconds representing when the location was recorded. |
| integer | Identifier of the sector where the device location belongs. Use this to map the coordinates to the correct floor, hall, or area in Twinzo. |
| integer | Expected time gap between localization records, in milliseconds. This helps consumers understand the sampling frequency of the data stream. |
| number | X coordinate of the device position in millimeters. |
| number | Y coordinate of the device position in millimeters. |
Coordinates are returned in millimeters. If your application expects meters, divide the values by 1000.
How to use it
Authenticate against the Twinzo API using the mechanism configured for your integration.
Call
GET /v3/devices/locations.Parse the returned JSON array.
Use
SectorIdto place the data into the correct sector context.Render or process
XandYas device coordinates over time.
A typical integration flow is:
Monitoring: show the latest known location of a device
Analytics: reconstruct movement paths from successive records
Validation: compare expected and actual positions from upstream localization sources
Automation: trigger events when devices enter relevant sector regions
Example request and response
GET /v3/devices/locations HTTP/1.1
Host: api.twinzo.com
Authorization: Bearer <access-token>
Accept: application/jsonExample response:
[
{
"Timestamp": 1782381265588,
"SectorId": 1,
"Interval": 1000,
"X": 1000,
"Y": 1000
},
{
"Timestamp": 1782381265588,
"SectorId": 1,
"Interval": 1000,
"X": 1370,
"Y": 1000
}
]Important notes
Only registered devices can provide meaningful localization data.
The returned coordinates depend on the configured sector coordinate system.
This response example contains only
XandY. Other localization-related models in Twinzo may include additional properties, but they are not required for this read scenario unless explicitly documented for this endpoint.If you are correlating data with device telemetry, use
TimestampandIntervaltogether to understand sequence and sampling rate.
Do not assume coordinates are globally valid across all sectors. Always interpret position values together with SectorId.
Related references
Localization Data — sending localization data to Twinzo
RTLS - Real-Time Location System — sector coordinate system background