Importing POI Data via JSON API

Summary

This technical document provides step-by-step instructions on how to set up a JSON API Source containing Points of Interest (POIs) data and import the POIs into MazeMap using the external JSON POI import feature. By following this guide, you'll be able to efficiently manage and import your POI data into MazeMap, enhancing the user experience and improving data organisation.

Skill Level: Advanced MazeMap

Prerequisites

Before you begin, ensure you have the following in place:

  1. Access to JSON API Source: Need to be able to pull the data

  2. API API response structure: The response from the JS API Call that gets matched to fields in MazeMap.

  3. Basic Coding Knowledge: While the guide will provide the necessary configuration, a basic understanding of JSON will be helpful for users to grasp the concepts.

Additional Considerations

Before proceeding with the setup, consider the following points:

  1. Data Privacy: Ensure that the JSON API document containing POI data is accessible only to authorised users, as the API is exposed to the web.

  2. JSON Format: An API call returns data in JSON format, and MazeMap requires specific field mappings. Users may need to adjust the script or MazeMap settings if the data fields need customisation.

Steps

1) Test the API Connection via online validator.

Follow these steps to test the API connection using Postman Web (which could be another validator).

  1. Go to the Postman website (https://www.postman.com/) and log in to your account.

  2. Click “My Workspace”.

  3. Click on the "+" button in the top-left corner next to “Overview”.

Postman Web

 

  1. Setup the API Call

    1. Select “Post” as the method

    2. enter the URL of the API including the sheet name from above.

    3. Click on the "Send" button to send the API request.

Check the API response
  1. After sending the request, you'll see the response from the API.
    If everything is set up correctly, you should receive a JSON response containing the structure and data from your API Call.

4) Setup and configure JSON POI Import

  1. Access MazeMap Admin tool MazeMap Admin and log in with your MazeMap account.

  2. Select the campus you would like to set the import up on.

  3. In the Map Editor, click Points of Interest menu followed by POI Import.

 

 

  1. Click the green button shown below to add a new configuration.

  1. Select the POI import configuration and configuration of the POI’s you are importing and give it a name and then click save.


Floorplan Label Condiguration

External Id Configrations

Manual POI ID configurtions

  1. In the configuration editor that has opened, add the JSON config which matches the type of POI Import you are undertaking.

    Examples of the different JSON configs are listed in the links below (or at the end of this document).

Floorplan Label POIs - example configuration
Internal POIs - Lat/Long/Floor - example configuration
External POIs - Lat/Long - example configuration
Manually Placed POIs - example configuration

JSON Explanation

{ "type": "json_row", # Import type set to json "source": 50, # Source id of json - '50' "clientConfig": { "method": "POST", # API method which is 'post' "headers": { "Content-Type": "application/json" # API content }, "params": {}, "debug": "true" # Debugging option set to true }, "uris": [ # Link to the API call which was copied before. Remember to add the sheet name you are referencing. "%link URL to API call% " ], "rowConfig": { "rowJPath": "$.imported_pois[*]", # This is the attribute that the json API returns the POIs under "columnJPaths": [ # Names of the header columns of the Google Sheet "field_1", "field_2", ... "field_10" ] }, "identifierSources": [ # Matching of the fields to MazeMap fields #See examples below for configuration and matching of fields to MazeMap Fields.

 

  • Remember to update the "uris": to the be the url of the API where you are importing data for

  • The configuration after "identifierSources"“ is identical to the setup of any excel import.

    Note: Not all fields need to be matched as the examples provided below are examples only.

 

  1. Click “save” in the bottom right of the window.

  1. Click “Validate Source” to validate the import and see the number of POIS. The total number imported POIs is listed and shown.

 

Conclusion

By following this technical documentation, you have successfully set up and imported Points of Interest (POIs) data from a Google Sheets document into MazeMap using a custom JSON API script. This integration enhances the user experience and provides an efficient way to manage POI data within MazeMap.

Replicate these instructions for different POI import types.

For any troubleshooting or further assistance, please refer to the MazeMap support resources or contact our technical support team.

Example JSON Configurations

Example JSON Config - Floorplan Label

{ "type": "json_row", "source": 50, "clientConfig": { "method": "POST", "headers": { "Content-Type": "application/json" }, "params": {}, "debug": "true" }, "uris": [ "%link_to_api_call%" ], "rowConfig": { "rowJPath": "%ocation_of_POI_data_in_response%", "columnJPaths": [ "floor_prefix", "room_id", "text_on_map", "title", "description", "type", "searchable", "url", "url_text", "comment" ] }, "identifierSources": [ { "importSourceId": 50, "itemCol": 1, "floorCol": 0, "externalIdCol": null, "poiIdCol": null, "comment": 9 } ], "poiInfo": [ { "nameCol": 1, "priority": 20, "comment": null }, { "nameCol": 2, "priority": 20, "comment": null }, { "nameCol": 3, "priority": 15, "comment": null }, { "nameCol": null, "typeCol": 6, "priority": 20, "comment": null } ], "poiData": [], "markers": [ { "textCol": 2, "priority": 20, "joinPriority": 20, "comment": null } ], "identifierNames": [], "richPoiUrlColumn": 7, "richPoiUrlTextColumn": 8, "richPoiDescriptionColumn": 4, "peopleCapacityColumn": null, "externalReferencesColumn": null }

 

Example JSON Config - Internal POI - Lat/Long/Floor

{ "type": "json_row", "source": 50, "clientConfig": { "method": "POST", "headers": { "Content-Type": "application/json" }, "params": {}, "debug": "true" }, "uris": [ "%link_to_api_call%" ], "rowConfig": { "rowJPath": "%i%ocation_of_POI_data_in_response%", "columnJPaths": [ "external_id", "floor_name", "lat", "lng", "text_on_map", "title", "description", "type", "searchable", "url", "url_text", "comment" ] }, "identifierSources": [ { "importSourceId": 50, "itemCol": null, "floorCol": null, "externalIdCol": 0, "poiIdCol": null, "comment": 11 } ], "poiInfo": [ { "nameCol": 4, "typeCol": null, "priority": 20, "comment": null }, { "nameCol": 5, "typeCol": null, "priority": 15, "comment": null }, { "nameCol": null, "typeCol": 7, "priority": 20, "comment": null }, { "nameCol": 8, "typeCol": null, "priority": 20, "comment": null } ], "poiData": [], "markers": [ { "textCol": 4, "priority": 20, "joinPriority": 20, "comment": null } ], "identifierNames": [], "geoCoordinates": [ { "latCol": 2, "lngCol": 3 } ], "richPoiUrlColumn": 9, "richPoiUrlTextColumn": 10, "richPoiDescriptionColumn": 6, "peopleCapacityColumn": null, "floorNameColumn": 1, "externalReferencesColumn": null }

 

Example JSON Config - External POI - Lat/Long

 

Example JSON Config - Manual POI Import