Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Retrieve a Collection of Buildings

 

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

Method

GET

URL

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

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

campusId

integer

The identifier of the campus.

name

string

The name of the campusbuilding.

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

Example Query Fragment

Code Block
themeMidnight
{
	"campusId": 1986
} 

URL-encoded, minified fragment:

No Format
%7B%22campusId%22%3A1986%7D

Example Request 

Panel
titleGET
http://map-api.phunware.com/v1.1/buildings?%7B%22campusId%22%3A1986%7D

Response

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

Code Block
themeMidnight
"data":
{
    [
        {
            "id": <integer>,
            "campusId": <integer>,
            "name": <string>,
            "latitude": <float>,
            "longitude": <float>,
            "streetAddress": <string>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "floors": <objectcontainingdataforanyfloors>,
            "venueGuid": <string>,
            "location": 
			{
                "latitude": <float>,
                "longitude": <float>
            },
            "externalId": <integer>
        },
        {
            "id": <integer>,
            "campusId": <integer>,
            "name": <string>,
            "latitude": <float>,
            "longitude": <float>,
            "streetAddress": <string>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "floors": null,
            "venueGuid": <string>,
            "location": 
			{
                "latitude": <float>,
                "longitude": <float>
            },
            "externalId": <integer>
        },
        ...
    ]
}

See Mapping API Response Handling for error payloads. 

Example Response

Example body of a successful response:

Code Block
themeMidnight
{
    "data": 
	[
        {
            "id": 5,
            "campusId": 1986,
            "name": "Hyrule Castle Tower",
            "latitude": 30.25,
            "longitude": 97.75,
            "streetAddress": "123 Ocarina",
            "createdAt": "2014-06-06T18:25:26Z",
            "updatedAt": "2014-06-06T18:25:33Z",
            "floors": null,
            "venueGuid": "03521872-2845-4024-896d-5fa0ab555c12",
            "location": 
			{
                "latitude": 30.25,
                "longitude": 97.75
            },
            "externalId": 5
        },
        {
            "id": 2,
            "campusId": 1986,
            "name": "Hyrule Castle Graveyard",
            "latitude": 31.25,
            "longitude": 98.75,
            "streetAddress": "123 Spirit Tracks",
            "createdAt": "2014-06-06T18:25:26Z",
            "updatedAt": "2014-06-06T18:25:33Z",
            "floors": null,
            "venueGuid": "03521872-2845-4024-896d-5fa0ab555c12",
            "location": 
			{
                "latitude": 31.25,
                "longitude": 98.75
            },
            "externalId": 2
        }
    ]
}

ON THIS PAGE

Table of Contents