المصطلحات والقواعد
Coordinate order, units, pagination, idempotency and request correlation. Read this once; it removes most integration bugs.
Coordinate order
Two shapes exist and they are not written the same way. Getting this backwards produces a request that succeeds and returns results in the wrong part of the world, which is harder to notice than an error.
| Where | Shape | Example |
|---|---|---|
| Query parameters | two named scalars | latitude=30.0444&longitude=31.2357 |
| JSON request body | named object | { "latitude": 30.0444, "longitude": 31.2357 } |
| GeoJSON geometry, route geometry | positional array | [31.2357, 30.0444] — longitude first |
| Style and tile sources | XYZ tiles | /v1/tiles/roads/12/2450/1655 |
Units
| Quantity | Unit | Notes |
|---|---|---|
| distance | metres | Integer or float, never kilometres |
| duration | seconds | Road duration, not straight-line |
| radius_m, accuracy_m, speed_mps | metres, metres, metres/second | The unit is in the parameter name |
| heading_deg | degrees | 0–360 clockwise from north |
| battery_pct | percent | 0–100 |
| timestamps | ISO 8601 UTC | Send an explicit Z or offset; a naive timestamp is rejected or read as UTC |
Pagination
List operations are cursor paginated with limit and cursor. A cursor is opaque: it encodes ordering and a position, and it is not a page number. Constructing one yourself returns a 422.
- Request the first page without cursor. Continue with the cursor the response returns; stop when it is absent, never when a page looks short.
- Defaults differ per operation and are published on each reference page. Place search defaults to 10 with a maximum of 50; autocomplete defaults to 8 with a maximum of 20.
- A cursor is only valid for the query that produced it. Changing a filter mid-walk restarts the walk.
- Cursors expire. If one is rejected, restart the walk instead of retrying it.
Idempotency
Metered POST operations accept an Idempotency-Key header. The intent is that retrying the same logical operation after a timeout never charges or applies it twice.
- Reuse one key for every retry of the same intent; use a new key for a new intent.
- Reusing a key with a different payload returns 409 idempotency_key_reuse.
- Sending the key while the original request is still running returns 409 idempotency_in_progress; retry later rather than changing the key.
- Tracking ingest has its own deduplication: client_event_id per event, client_seq per device. Use them for location data instead of an Idempotency-Key.
Request correlation
Every response carries X-Bardiya-Request-Id, including failures. The value also appears inside the error envelope as error.request_id. Log it with the status code, the operation and your own correlation id: it is the only reliable way for support to find one request among millions.
Content type and encoding
- Send and accept application/json, UTF-8.
- Arabic input is accepted directly as UTF-8. Do not transliterate and do not pre-normalise: the index folds diacritics, alef variants and ta marbuta itself.
- Requests with a body accept an explicit Content-Type; omitting it returns 422.
- Responses are not compressed beyond the transport layer; a large matrix or history page is large by design, so paginate.
