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 Collection of Routes

 

This method is used to retrieve an array of routes that satisfy search criteria.

Method

GET

URL

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

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined. While floorId, startPointId and endPointId are marked as required, only one is necessary for a successful request.

Parameter

Value

Description

floorId

integer

The ID of the floor to get the routes for.

startPointId

integer

The ID of the starting point to match routes against.

endPointId

string

The ID of the ending point to match routes against.

isAccessible

Boolean

Specifies whether to return accessible routes only.

includePoints

Boolean

If true, full point data will be returned within the routes that are found. If false, only the IDs of the points will be included in the returned routes. This is for the convenience of callers that prefer a smaller payload in the response body.

limit

integer

Specifies the number of results to return. This is useful for pagination.

Default value: 10

Maximum value: 100

offset

integer

Specifies the number of results to offset. This is useful for pagination.  

Default value: 0

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

Example Query Fragment

{
	"startPointId": 78757, 
	"isAccessible": true, 
	"floorId": 17, 
	"limit": 2
} 

URL-encoded, minified fragment:

%7B%22startPointId%22%3A78757%2C%22isAccessible%22%3Atrue%2C%22floorId%22%3A17%2C%22limit%22%3A2%7D 

Example Request

GET
http://map-api.phunware.com/v1.1/routes?%7B%22startPointId%22%3A78757%2C%22isAccessible%22%3Atrue%2C%22floorId%22%3A17%2C%22limit%22%3A2%7D 

Response

A successful response will have a 200 status code and a body containing an array of routes that satisfy the query parameters:

{
    "data": 
	[
        {
            "id": <integer>,
            "name": <string>,
            "startPointId": <integer>,
            "endPointId": <integer>,
            "isAccessible": <Boolean>,
            "pointIds": <string>,
            "status"<integer>,
            "floorId": <integer>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "data": <string>,
            "externalId": <integer>
        },
        {
            "id": <integer>,
            "name": <string>,
            "startPointId": <integer>,
            "endPointId": <integer>,
            "isAccessible": <Boolean>,
            "pointIds": <string>,
            "status"<integer>,
            "floorId": <integer>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "data": <string>,
            "externalId": <integer>
        },
        ...
    ],
    "pagination": 
	{
        "results": <object>,
        "pages": <object>
    }
}

The "pagination" and "pages" elements of the response body provide information about the number of items found by the search, how many of those have been returned in the payload and whether there are any other pages of results.

If route generation is in progress, a 202 "Accepted" status code will be returned with an empty set of results to indicate that the resource is not currently available. Example response body:

{
    "data": 
	[
        
    ],
    "pagination": 
	{
        "results": 
		{
            "from": <integer>,
            "to": <integer>,
            "total": <integer>
        },
        "pages": 
		{
            "current": <integer>,
            "prev": <integer>,
            "next": <integer>,
            "total": <integer>
        }
    }
}

If route generation fails, a 500-series status code will be returned. 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>
            ],
            "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>
            ],
            "externalId": 11
        }
    ],
    "pagination": 
	{
        "results": 
		{
            "from": 1,
            "to": 2,
            "total": 2
        },
        "pages": 
		{
            "current": 1,
            "prev": null,
            "next": null,
            "total": 1
        }
    }
} 

ON THIS PAGE

 

 

  • No labels