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.

Mapping API Rich Example

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.

1. Create a Venue

 

A venue is a location where events take place. Venues consist of one or more campuses.

Hyrule

The example request below creates a venue called Hyrule. The example response returns the newly created venue's GUID. 

Example Request 

POST /v1.1/venues HTTP/1.1 
Host: map-api.phunware.com
X-Auth: see MaaS Security Protocol v1.0
Content-Type: application/json
{
    "name": "Hyrule",
    "appId": "123456",
    "clientIds": "98765,6543",
    "orgIds": "8,9",
    "mseUdi": "abcd",
    "supportsGeographicCoordinates": true
}

Example Response

HTTP/1.1 200 OK 
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Date: Tue, 20 May 2015 16:06:54 GMT
Connection: keep-alive
{
    "data": 
	{
        "guid": "f0685279-7497-4d90-882e-12201e476b0e"
    }
}

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.

2. Create a Campus

 

A campus is a collection of one or more buildings grouped together by a common theme.

Hyrule Castle

The example request below creates a campus called Hyrule Castle. The example response returns the newly created campus' ID. 

Hyrule Castle will live inside of the Hyrule venue, its parent container. 

Example Request

POST /v1.1/campuses HTTP/1.1 
Host: map-api.phunware.com
X-Auth: see MaaS Security Protocol v1.0
Content-Type: application/json
{    
	"name": "Hyrule Castle",
    "venueGuid": "f0685279-7497-4d90-882e-12201e476b0e"
} 

Example Response

HTTP/1.1 200 OK 
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Date: Tue, 20 May 2015 16:06:54 GMT
Connection: keep-alive
{    
	"data": 
    {
        "id": 1986
    }
}

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.

3. Create a Building

 

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

Hyrule Castle Tower

The example request below creates a building called Hyrule Castle Tower. The example response returns the newly created building's ID. 

Hyrule Castle Tower will live inside of the Hyrule Castle campus, its parent container. 

Example Request

POST /v1.1/buildings HTTP/1.1 
Host: map-api.phunware.com
X-Auth: see MaaS Security Protocol v1.0
Content-Type: application/json
{    
	"campusId": 1986,
    "name": "Hyrule Castle Tower",
    "latitude": 30.25,
    "longitude": 97.75,
    "streetAddress": "123 Ocarina",
    "venueGuid": "f0685279-7497-4d90-882e-12201e476b0e",
    "location": 
    {
        "latitude": 30.25,
        "longitude": 97.75
    }
}

Example Response

HTTP/1.1 200 OK 
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Date: Tue, 20 May 2015 16:06:54 GMT
Connection: keep-alive
{    
	"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.

4. Create a Floor

 

A floor is an object associated with a building containing a building ID, floor ID, zoom level and resource URL(s) (e.g. .svg, .pdf).

Level One

The example request below creates a floor called Level One. The example response returns the newly created floor's ID. 

Level One will live inside of the Hyrule Castle Tower building, its parent container. 

Example Request

POST /v1.1/floors HTTP/1.1 
Host: map-api.phunware.com
X-Auth: see MaaS Security Protocol v1.0
Content-Type: application/json
{    
	"venueGuid": "f0685279-7497-4d90-882e-12201e476b0e",
    "buildingId": 6891,
    "name": "Level One",
    "originalMapUrl": "http://image.com/level1.pdf",
    "level": 1,
    "isOutdoor": false,
    "width": 100,
    "height": 200,
    "offsetX": 0,
    "offsetY": 0,
    "locationMapHierarchy": "Hyrule Castle>Hyrule Castle Tower>Level One",
    "maxZoomLevel": 3,
    "referencePoints": 
    {
        "rotation": 214,
        "portal": 
        {
            "topRight": 
            {
                "latitude": 33.77403309960294,
                "longitude": -84.32867120304763
            },
            "bottomLeft": 
            {
                "latitude": 33.7740738782866,
                "longitude": -84.32673443277963
            }
        },
        "topLeft": 
        {
            "latitude": 33.773309,
            "longitude": -84.327331
        },
        "topRight": 
        {
            "latitude": 33.774033,
            "longitude": -84.328671
        },
        "bottomLeft": 
        {
            "latitude": 33.774073,
            "longitude": -84.326734
        },
        "bottomRight": 
        {
            "latitude": 33.774797,
            "longitude": -84.328074
        }
    }
} 

Example Response

HTTP/1.1 200 OK 
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Date: Tue, 20 May 2015 16:06:54 GMT
Connection: keep-alive
{    
	"data": 
    {
        "id": 17
    }
} 

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.

5. Create a Resource

 

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

Map for Level One

The example request below creates a map for the floor named Level One. The example response returns the newly created resource's ID. 

The map resource for Level One will be associated with the Level One floor. 

Example Request

POST /v1.1/resources HTTP/1.1 
Host: map-api.phunware.com
X-Auth: see MaaS Security Protocol v1.0
Content-Type: application/json
{    
	"floorId": 17,
    "pdfUrl": "http://image.com/level1.pdf",
    "svgUrl": "http://image.com/level1.svg",
    "zoomLevel": 0
} 

Example Response

HTTP/1.1 200 OK 
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Date: Tue, 20 May 2015 16:06:54 GMT
Connection: keep-alive
{    
	"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.

6. Retrieve a Venue

 

Hyrule

The example request below retrieves the Hyrule venue, which can now be represented by this hierarchy of resources:

  • Hyrule (venue)
    • Hyrule Castle (campus)
      • Hyrule Castle Tower (building)
        • Level One (floor)
          • http://image.com/level1.pdf and http://image.com/level1.svg (resource)

The example response will contain the venue object only. 

Example Request

GET /v1.1/venues/f0685279-7497-4d90-882e-12201e476b0e HTTP/1.1 
Host: map-api.phunware.com
X-Auth: see MaaS Security Protocol v1.0
Content-Type: application/json

Example Response

HTTP/1.1 200 OK 
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Date: Tue, 20 May 2015 16:06:54 GMT
Connection: keep-alive
{    
	"guid": "f0685279-7497-4d90-882e-12201e476b0e",
    "name": "Hyrule",
    "appId": "123456",
    "clientIds": "98765,6543",
    "orgIds": "8,9",
    "isActive": true,
    "mseUdi": "abcd",
    "callbackUrl": "http://www.Hyrule.com",
    "createdAt": "2015-05-20T16:06:54Z",
    "updatedAt": null,
    "supportsGeographicCoordinates": true
}

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.

7. View the Venue in the Map Editor

 

 

The steps below assume that your organization's application has already been created in the MaaS portal. If your organization was not provided with login credentials, contact your Phunware program manager.

Once the developer has successfully created floor resources for the venue, those floor resources will become available as maps in the MaaS portal's Map Editor (pictured right).

Using the Map Editor, credentialed users can add points of interest (POIs), waypoints, segments, routes and zones (geofences) using the toolbar. 

There is no action required on the developer's part to make this map available for use in the Map Editor. This page will walk through the steps to take to access the new venue's map in the MaaS portal. 

STEPS

  1. Log into maas.phunware.com using your organization's credentials. 
  2. The YOUR APPLICATIONS page will display. 
  3. Click the LOCATION tab in the lefthand sidebar. 
  4. Click the MAP EDITOR button. 
  5. Use the three drop-down menus in the top navigation bar to select your: 
    1. venue
    2. campus
    3. floor
  6. Your newly created venue's resources (maps) will display. 
  7. From here, use the toolbar in the Map Editors upper righthand corner to add points of interest (POIs), waypoints, segments, routes and zones (see right). 

The Mapping API Rich Example assumes that your organization's application has already been created in the MaaS portal. If your organization was not provided with login credentials, contact your Phunware program manager.

This document provides examples that showcase how developers can build an example venue. Upon completion, the venue will appear in the Multiscreen as a Service (MaaS) portal's Map Editor, where credentialed users can then create points of interest (POIs), segments and routes for the newly created venue's map.

For a venue to appear in the Map Editor, it must contain a building, campus, floor and (floor) resource, at a minimum. Here is a hierarchy of the items the developer will create: 

  • Hyrule (venue)
    • Hyrule Castle (campus)
      • Hyrule Castle Tower (building)
        • Level One (floor)
          • http://image.com/level1.pdf (resource)
          • http://image.com/level1.svg (resource)

All Mapping API objects—venues, campuses, buildings, floors, resources, points, POI types, POI type metadata, routes and segments—can be created at the API level. A subset of these will be created for this Mapping API Rich Example. See Mapping API Methods for the specific calls to make.

  • No labels