Skip to content

Find a route through the space

GET
/{resource}/query/route
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.

resource
required
string
/^\d+$/

The project ID of the space

origin
required
string

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.2
destination
required
string

Where the route ends, given as origin is.

stepFree
boolean

Prefer a route without steps or stairs. If there isn’t one, the ordinary route is given, with stepFree false.

avoidElevators
boolean

Only use elevators where there’s no other way.

The route

Media typeapplication/json
object
route
object
partial
required

Whether the route stops short of the destination, as close as it can get.

boolean
stepFree
required

Whether the route was found on the step-free navigation mesh.

boolean
summary
required
object
distance

The route’s length, in metres.

number
timeSeconds

Roughly how long it takes to follow, in seconds.

number
steps

Roughly how many steps up or down it takes.

number
numElevators

How many elevators it takes.

integer
startPosition
required

Where the route starts: the origin, moved onto walkable floor.

array
>= 3 items <= 3 items
endPosition
required

Where the route ends: the destination, moved onto walkable floor.

array
>= 3 items <= 3 items
path
required

The points along the route, in order.

Array<object>
object
position
required

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.

array
>= 3 items <= 3 items
elevator

Set where the route takes an elevator: the two elevator call panels it’s between.

object
a
string
b
string

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

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

There’s no token, and the space isn’t public (authenticationRequired) - or the token is invalid

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The token has no access to this space.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

No entity has the id given (notFound), or there’s no route between the points (noRoute)

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The space has no navigation mesh (noNavMesh)

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

Too many requests. Retry after Retry-After seconds.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}
Retry-After
integer

Seconds to wait before retrying

Something upstream failed.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The space is moving between servers. Retry after Retry-After seconds.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}
Retry-After
integer

Seconds to wait before retrying

Something upstream timed out.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}