Find a route through the space
const url = 'https://example.com/v1/example/query/route?origin=2.5%2C0%2C-1.2&destination=example&stepFree=false&avoidElevators=false';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/example/query/route?origin=2.5%2C0%2C-1.2&destination=example&stepFree=false&avoidElevators=false' \ --header 'Authorization: Bearer <token>'The route a visitor would be shown between two points, worked out as the app works it out - over the navigation mesh, through doors, nav connections and elevators.
A token is optional for public spaces. Without one, the route is found in the space as it was last published, positions are rounded to 10cm, answers are cached for 15 seconds, and requests are limited for each client address. With one, it’s found in the live space.
Authorizations
Section titled “Authorizations”- token
- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project ID of the space
Query Parameters
Section titled “Query Parameters”Where the route starts: a position as x,y,z in metres, or the id of an entity - a landmark (its presentation point if it has one), immersive frame, door or elevator call panel.
Example
2.5,0,-1.2Where the route ends, given as origin is.
Prefer a route without steps or stairs. If there isn’t one, the ordinary route is given, with stepFree false.
Only use elevators where there’s no other way.
Responses
Section titled “Responses”The route
object
object
Whether the route stops short of the destination, as close as it can get.
Whether the route was found on the step-free navigation mesh.
object
The route’s length, in metres.
Roughly how long it takes to follow, in seconds.
Roughly how many steps up or down it takes.
How many elevators it takes.
Where the route starts: the origin, moved onto walkable floor.
Where the route ends: the destination, moved onto walkable floor.
The points along the route, in order.
object
A point [x, y, z] in metres, in the space’s coordinate frame. The frame is shared by every floor and map, with +y up.
Set where the route takes an elevator: the two elevator call panels it’s between.
object
Example
{ "route": { "startPosition": [ 1.5, 0, -3.2 ], "endPosition": [ 1.5, 0, -3.2 ], "path": [ { "position": [ 1.5, 0, -3.2 ] } ] }}An origin or destination is missing, out of range, or an entity that can’t be routed to
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}There’s no token, and the space isn’t public (authenticationRequired) - or the token is invalid
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token has no access to this space.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}No entity has the id given (notFound), or there’s no route between the points (noRoute)
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The space has no navigation mesh (noNavMesh)
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Too many requests. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream failed.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The space is moving between servers. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream timed out.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}