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.

BUILDING

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.

Create a Building

 

This method is used to create a building.  This will create a draft building.  Buildings may only be created on draft campuses.

Method

POST

URL

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

Headers

X-Auth (see Security)

Request Body

Required parameters are underlined.

Parameter

Value

Description

campusId

integer

The identifier of the campus that the building belongs to.

name

string

The name of the building.

latitude

float

The latitude in decimal degrees. Present for backwards compatibility. In version 1.1 of the API, the latitude should be contained within a location field, as indicated below.

longitude

float

The longitude in decimal degrees. Present for backwards compatibility. In version 1.1 of the API, the longitude should be contained within a location field, as indicated below.

streetAddress

string

The street address of the building.

venueGuid

string

The identifier of the venue that the building belongs to.

location

object

An object containing the actual, physical location of the building. Possible values:

  • latitude (number): The latitude in decimal degrees.
  • longitude (number): The longitude in decimal degrees.
{
    "campusId": <integer>,
    "name": <string>,
    "latitude": <number>,
    "longitude": <number>,
    "streetAddress": <string>,
    "venueGuid": <string>,
    "location": 
	{
        "latitude": <number>,
        "longitude": <number>
    }
} 

Example Request

POST the following request body to: http://map-api.phunware.com/v1.1/buildings

{
    "campusId": 1986,
    "name": "Hyrule Castle Tower",
    "latitude": 30.25,
    "longitude": 97.75,
    "streetAddress": "123 Ocarina",
    "venueGuid": null,
    "location": 
	{
        "latitude": 30.25,
        "longitude": 97.75
    }
}

Response

A successful response will have a 200 status code and a body containing the newly created building's ID:

{
    "data": 
	{
        "id": <integer>
    }
} 

See Mapping API Response Handling for error payloads. 

Example Response

Example body of successful response:

{
    "data": 
	{
        "id": 6891
    }
}

ON THIS PAGE

 

 

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 Building

 

This method is used to retrieve a building by building ID. A building can be retrieved such that the response also contains information about the floors it contains. This is done by passing the parameter "deep":true. Passing "deep":false requests only data about the building itself. The default behavior is "deep":true.

The latitude and longitude information is duplicated in the JSON payloads for backwards compatibility with v1.0. Using the "location" field for latitude and longitude values is preferred and takes precedence if there are any differences. Use of the previous latitude and longitude fields outside of a location object has been deprecated.

Method

GET

URL

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

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

deep

Boolean

Information about a building can be retrieved along with floor details by passing true. Passing false requests only data about the building itself.

 Default value: true

draftStatusStringEither "LIVE" or "DRAFT". Defaults to "LIVE".

Example Query Fragment

Example with "deep" set to false:

{
	"deep": false
}  

Example with "deep" set to true:

{
	"deep": true
} 

URL-encoded, minified fragment for "deep" set to false:

7B%22deep%22%3Afalse%7D 

URL-encoded, minified fragment for "deep" set to true:

%7B%0A%22deep%22%3A+true%0A%7D

Example Request

Example with "deep" set to false:

GET
http://map-api.phunware.com/v1.1/buildings/6891?7B%22deep%22%3Afalse%7D

Example with "deep" set to true:

GET
http://map-api.phunware.com/v1.1/buildings/6891?%7B%0A%22deep%22%3A+true%0A%7D

Response

If "deep" is set to false, a successful response will have a 200 status code and a body containing an object with building data that does not contain information about the floors of the building:

{
    "id": <integer>,
    "name": <string>,
    "campusId": <integer>,
    "latitude": <float>,
    "longitude": <float>,
    "streetAddress": <string>,
    "createdAt": <string>,
    "updatedAt": <string>,
    "floors": null"venueGuid": <string>,
    "location": 
	{
        "latitude": <float>,
        "longitude": <float>
    },
    "externalId": <integer>
} 

If "deep" is set to true, a successful response will have a 200 status code and a body containing an object with building data that contains information about its floors:

{
    "id": <integer>,
    "name": <string>,
    "campusId": <integer>,
    "latitude": <float>,
    "longitude": <float>,
    "streetAddress": <string>,
    "createdAt": <string>,
    "updatedAt": <string>,
    "floors": 
	[
        {
            "id": <integer>,
            "name": <string>,
            "originalMapUrl": <string>,
            "buildingId": <integer>,
            "level": <integer>,
            "isOutdoor": <Boolean>,
            "width": <decimal>,
            "height": <decimal>,
            "offsetX": <integer>,
            "offsetY": <integer>,
            "locationMapHierarchy": <string>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "buildingId": <integer>,
            "resources": 
			[
                {
                    "id": <integer>,
                    "buildingId": <integer>,
                    "floorId": <integer>,
                    "pdfUrl": <string>,
                    "svgUrl": <string>,
                    "zoomLevel": <integer>,
                    "createdAt": <string>,
                    "updatedAt": <string>
                }
            ],
            "venueGuid": <string>,
            "maxZoomLevel": <int>,
            "referencePoints": 
			{
                "rotation": <decimal>,
                "topLeft": 
				{
                    "latitude": <decimal>,
                    "longitude": <decimal>
                },
                "topRight": 
				{
                    "latitude": <decimal>,
                    "longitude": <decimal>
                },
                "bottomLeft": 
				{
                    "latitude": <decimal>,
                    "longitude": <decimal>
                },
                "bottomRight": 
				{
                    "latitude": <decimal>,
                    "longitude": <decimal>
                },
                "portal": 
				{
                    topRight":
					{
						"latitude": <decimal>,
						"longitude": <decimal>
					},
					"bottomLeft":
					{
						"latitude": <decimal>,
						"longitude": <decimal>
					}
				}
			}
		}
	],
	"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 for "deep" set to false:

{
    "id": 2,
    "name": "Hyrule Castle Tower",
    "campusId": 6891,
    "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": 2
}

Example body of a successful response for "deep" set to true:

{
    "id": 2,
    "campusId": 6891,
    "name": "Hyrule Castle Tower",
    "latitude": 30.25,
    "longitude": 97.75,
    "streetAddress": "123 Ocarina",
    "createdAt": "2014-07-10T14:56:49Z",
    "updatedAt": "2014-07-10T14:56:49Z",
    "floors": 
	[
        {
            "id": 17,
            "buildingId": 6891,
            "name": "Floor 1",
            "originalMapUrl": null,
            "isOutdoor": false,
            "level": 1,
            "width": 300.0,
            "height": 150.0,
            "offsetX": 0,
            "offsetY": 0,
            "locationMapHierarchy": "Hyrule>Hyrule Castle>Hyrule Castle Tower>Floor 1",
            "resources": 
			[
                {
                    "id": 5453,
                    "floorId": 4343,
                    "pdfUrl": "http://image.com/level1.pdf",
                    "svgUrl": "http://image.com/level1.svg",
                    "zoomLevel": 0,
                    "createdAt": "2002-10-02T10:00:00Z",
                    "updatedAt": "2002-10-02T10:00:00Z"
                }
            ],
            "venueGuid": "03521872-2845-4024-896d-5fa0ab555c12",
            "maxZoomLevel": 1,
            "referencePoints": 
			{
                "rotation": 0.0,
                "topLeft": 
				{
                    "latitude": 37.326617,
                    "longitude": -121.948756
                },
                "topRight": 
				{
                    "latitude": 37.326617,
                    "longitude": -121.942209
                },
                "bottomLeft": 
				{
                    "latitude": 37.324086,
                    "longitude": -121.948756
                },
                "bottomRight": 
				{
                    "latitude": 37.324086,
                    "longitude": -121.942209
                },
                "portal": 
				{
                    "topRight": 
					{
                        "latitude": 37.326617,
                        "longitude": -121.942209
                    },
                    "bottomLeft": 
					{
                        "latitude": 37.324086,
                        "longitude": -121.948756
                    }
                }
            }
        }
    ],
	"venueGuid": "03521872-2845-4024-896d-5fa0ab555c12",
    "location": 
	{
        "latitude": 30.25,
        "longitude": 97.75
    },
    "externalId": 2
}

ON THIS PAGE

 

 

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 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 building.

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

Example Query Fragment

{
	"campusId": 1986
} 

URL-encoded, minified fragment:

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

Example Request 

GET
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:

"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:

{
    "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

 

 

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.

Update a Building

 

This method is used to update an existing building.  Only draft buildings (i.e. buildings that belong to a draft campus) may be modified via this method.

Method

PUT

URL

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

Headers

X-Auth (see Security)

Request Body

See Mapping API Architecture > PUT Methods & Partial Updates.

Parameter

Value

Description

campusId

integer

The identifier of the campus to which this building belongs.

name

string

The name of the building.

latitude

float

The latitude of this building in decimal degrees. Present for backwards compatibility. In version 1.1 of the API, the latitude should be contained within a location field, as indicated below.

longitude

float

The longitude of this building in decimal degrees. Present for backwards compatibility. In version 1.1 of the API, the longitude should be contained within a location field, as indicated below.

streetAddress

string

The street address of this building.

venueGuid

string

The identifier of the venue to which this building belongs.

location

object

An object containing the actual, physical location of the building. Possible values:

  • latitude (number): The latitude of this building in decimal degrees.
  • longitude (number): The longitude of this building in decimal degrees.
{
	"campusId": <integer>,
	"streetAddress": <string>
} 

Example Request

PUT the following request body to: http://map-api.phunware.com/v1.1/buildings/6891

{
	"campusId": 1987,
	"streetAddress": "123 Majora"
}

Response

A success response will return a 204 status code with no data in the body of the response. See Mapping API Response Handling for error payloads.

ON THIS PAGE

 

 

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.

Delete a Building

 

This method is used to delete a building.  Only draft buildings (i.e. buildings that belong to a draft campus) may be modified via this method.

Method

DELETE

URL

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

Headers

X-Auth (see Security)

Request Parameters

None

Example Request

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

Response

A success response will return a 204 status code with no data in the body of the response. See Mapping API Response Handling for error payloads.

ON THIS PAGE

 

 

 

A building is a physical structure that contains one or more floors.

{
    "id": <string>,
    "name": <string>,
    "campusId": <integer>,
    "latitude": <decimal>,
    "longitude": <decimal>,
    "streetAddress": <string>,
    "floors": 
	[
        <floorobject1>,
        <floorobject2>,
        ...
    ],
    "location": 	
	{
        "latitude": <decimal>,
        "longitude": <decimal>
    }
}
  • No labels