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.

RESOURCE

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 Resource

 

This method is used to create a resource for a floor.  This will create a draft resource.  Resources may only be created on draft floors.

Method

POST

URL

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

Headers

X-Auth (see Security)

Request Body

Required parameters are underlined.

Parameter

Value

Description

floorId

integer

The identifier of the floor that this resource belongs to.

pdfUrl

string

The URL for the .pdf file associated with this floor.

svgUrl

string

The URL for the .svg file associated with this floor.

zoomLevel

integer

The zoom level for this floor.

{
    "floorId": <integer>,
    "pdfUrl": <string>,
    "svgUrl": <string>,
    "zoomLevel": <integer>
}

Example Request

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

{
    "floorId": 17,
    "pdfUrl": "http://image.com/level1.pdf",
    "svgUrl": "http://image.com/level1.svg",
    "zoomLevel": 0
} 

Response

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

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

See Mapping API Response Handling for error payloads.

Example Response

Example body of successful response:

{
    "data": 
	{
        "id": 71
    }
}

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 Resource

 

This method is used to retrieve a floor's resource by resource ID.

Method

GET

URL

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

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

draftStatus

string

Either "LIVE" or "DRAFT". Defaults to "LIVE".


Example Request

GET
http://map-api.phunware.com/v1.1/resources/71

Response

A successful response will have a 200 status code and a body containing an object with resource data:

{
    "id": <integer>,
    "floorId": <integer>,
    "pdfUrl": <string>,
    "svgUrl": <string>,
    "zoomLevel": <integer>,
    "createdAt": <string>,
    "updatedAt": <string>,
    "externalId": <integer>
}

See Mapping API Response Handling for error payloads. 

Example Response

Example body of a successful response:

{
    "id": 71,
    "floorId": 17,
    "pdfUrl": "http://image.com/level1.pdf",
    "svgUrl": "http://image.com/level1.svg",
    "zoomLevel": 0,
    "createdAt": "1990-12-31T23:59:30Z",
    "updatedAt": " 1990-12-31T23:59:30Z",
    "externalId": 71
} 

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 Resources

 

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

Method

GET

URL

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

Headers

X-Auth (see Security)

Query Parameters

Required parameters are underlined.

Parameter

Value

Description

floorId

integer

The identifier of the floor.

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

Example Query Fragment

{
	"floorId": 17
} 

URL-encoded, minified fragment:

%7B%22floorId%22%3A17%7D

Example Request 

GET
http://map-api.phunware.com/v1.1/resources?%7B%22floorId%22%3A17%7D

Response

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

{
    "data": 
	[
        {
            "id": <integer>,
            "floorId": <integer>,
            "pdfUrl": <string>,
            "svgUrl": <string>,
            "zoomLevel": <integer>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "externalId": <integer>
        },
        {
            "id": <integer>,
            "floorId": <integer>,
            "pdfUrl": <string>,
            "svgUrl": <string>,
            "zoomLevel": <integer>,
            "createdAt": <string>,
            "updatedAt": <string>,
            "externalId": <integer>
        },
        ...
    ]
} 

See Mapping API Response Handling for error payloads.

Example Response

Example body of a successful response:

{
    "data": 
	[
        {
            "id": 71,
            "floorId": 17,
            "pdfUrl": "http://image.com/level1.pdf",
            "svgUrl": "http://image.com/level1.svg",
            "zoomLevel": 0,
            "createdAt": "2013-09-03T13:32:55Z",
            "updatedAt": "2013-09-03T13:32:55Z",
            "externalId": 71
        },
        {
            "id": 72,
            "floorId": 17,
            "pdfUrl": "http://image.com/resource.pdf",
            "svgUrl": "http://image.com/resource.svg",
            "zoomLevel": 1,
            "createdAt": "2013-09-03T13:32:55Z",
            "updatedAt": "2013-09-03T13:32:55Z",
            "externalId": 72
        }
    ]
}

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 Resource

 

This method is used to update an existing floor resource.  Only draft resources (i.e. resources that belong to a draft floor) may be modified via this method.

Method

PUT

URL

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

Headers

X-Auth (see Security)

Request Body

See Mapping API Architecture > PUT Methods & Partial Updates.

Parameter

Value

Description

floorId

integer

The identifier of the floor that this resource belongs to.

pdfUrl

string

The URL for the .pdf file associated with this floor.

svgUrl

string

The URL for the .svg file associated with this floor.

zoomLevel

integer

The zoom level for this floor.

{    
    "floorId": <integer>,
    "pdfUrl": <string>,
    "svgUrl": <string>,
    "zoomLevel": <integer>
}

Example Request

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

{    
    "floorId": 17,
    "pdfUrl": "http://image.com/level1.pdf",
    "svgUrl": "http://image.com/level1.svg",
    "zoomLevel": 0
} 

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 Resource

 

This method is used to delete a resource and any associated floor resource assets.  Only draft resources (i.e. resources that belong to a draft floor) may be modified via this method.

Method

DELETE

URL

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

Headers

X-Auth (see Security)

Request Parameters

None

Example Request

DELETE
http://map-api.phunware.com/v1.1/resources/17

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

 

 

 

The image files associated with a floor. The .svg or .pdf asset URL and the associated metadata are often referred to as a map.

{
    "id": <integer>,
    "floorId": <integer>,
    "pdfUrl": <string>,
    "svgUrl": <string>,
    "zoomLevel": <integer>,
    "createdAt": <string>,
    "updatedAt": <string>,
    "externalId": <integer>
}
  • No labels