Skip to end of metadata
Go to start of metadata

This documentation is no longer actively supported and may be out of date. Going forward, please visit and bookmark our new site (https://docs.phunware.com/) for up-to-date documentation.

Retrieve a Location's Routes

 

This method is used to retrieve the route from a given [x,y] or [lat,long] location to a POI.

Method

GET

URL

http://map-api.phunware.com/v1.1/routes/getFromLocation

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

floorId

integer

The ID of the floor to get the routes for.

destinationPOI

integer

The ID of the destination POI.

x

decimal

The x-coordinate to find routes from. Either x,y or location information is required.

y

decimal

The y-coordinate to find routes from. Either x,y or location information is required.

location

object

An object containing the latitude and longitude, in decimal degrees, to find routes from. Either x,y or location information is required.

isAccessible

Boolean

Specifies whether to return accessible routes only.

draftStatusstringEither "LIVE" or "DRAFT". Defaults to "LIVE".

Example Query Fragment

Example fragment for [x,y] location:

{
	"x": 230.4,
	"y": 154.1,
	"floorId": 17,
	"destinationPOI": 78759
}

Example fragment for [lat,long] location: 

{
    "location": 
	{
        "latitude": 30.25,
        "longitude": 97.75
    },
    "floorId": 17,
    "destinationPOI": 78759
}

URL-encoded, minified fragment for [x,y] location:

%7B%0A%22x%22%3A230.4%2C%0A%22y%22%3A154.1%2C%0A%22floorId%22%3A17%2C%0A%22destinationPOI%22%3A374131%0A%7D 

URL-encoded, minified fragment for [lat,long] location:

%7B%22location%22%3A%7B%22latitude%22%3A30.25%2C%22longitude%22%3A97.75%7D%2C%22floorId%22%3A1017%2C%22destinationPOI%22%3A374131%7D

Example Request

Example request for [x,y] location:

GET
http://map-api.phunware.com/v1.1/routes/getFromLocation?%7B%0A%22x%22%3A230.4%2C%0A%22y%22%3A154.1%2C%0A%22floorId%22%3A1017%2C%0A%22destinationPOI%22%3A374131%0A%7D 

Example request for [lat,long] location:

GET
http://map-api.phunware.com/v1.1/routes/getFromLocation?%7B%22location%22%3A%7B%22latitude%22%3A30.25%2C%22longitude%22%3A97.75%7D%2C%22floorId%22%3A1017%2C%22destinationPOI%22%3A374131%7D

Response

A successful response will have a 200 status code and a body containing an array of routes.

{
    "data": 
	[
        {
            "id": <integer>,
            "name": <string>,
            "startPointId": <integer>,
            "endPointId": <integer>,
            "isAccessible": <Boolean>,
            "pointIds": <string>"status": <integer>,
            "floorId": <integer>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "data": 
			[
                <point object 1>,
                <point object 2>,
                ...
            ],
            "isDirty": <Boolean>,
            "externalId": <integer>
        }
    ]
} 

See Mapping API Response Handling for error payloads.

Example Response

Example body of a successful response:

{
    "data": 
	[
        {
            "id": 10,
            "name": "The Throne Room-STAIRS",
            "startPointId": 78757,
            "endPointId": 78759,
            "isAccessible": true,
            "pointIds": "78757,78758,78759",
            "status:"null,
            "floorId": 17,
            "createdAt": "2014-06-14T12:21:38Z",
            "updatedAt": null,
            "data": 	
			[
                <object containing point ID 78757 data>,
                <object containing point ID 78758 data>,
                <object containing point ID 78759 data>
            ],
            "isDirty": null,
            "externalId": 10
        },
        {
            "id": 11,
            "name": "Beedle's Bomb Shop-RESTROOM",
            "startPointId": 78701,
            "endPointId": 78703,
            "isAccessible": true,
            "pointIds": "78701,78702,78703",
            "status:"null,
            "floorId": 1,
            "createdAt": "2014-06-14T12:21:38Z",
            "updatedAt": null,
            "data": 
			[
                <object containing point ID 78701 data>,
                <object containing point ID 78702 data>,
                <object containing point ID 78703 data>
            ],
            "isDirty": null,
            "externalId": 11
        }
    ]
} 

ON THIS PAGE

 

 

  • No labels