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.

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

 

 

  • No labels