Skip to main content

Integration API

Introduction and Getting Started

From the MapsIndoors Integration API you can get, add, change and delete data related to your MapsIndoors Solution via a REST service.

Send your requests to this endpoint: https://integration.mapsindoors.com

Note: Only HTTPS is supported. There is a rate limit of 10 requests per second per Solution.

You can access data through the Integration API using a range of endpoints. The endpoints are described in the Swagger interface definition: https://integration.mapsindoors.com/doc

In Swagger, each GET method is pre-loaded with all mandatory fields needed to get a live example of data. Click the "Try it out" button in Swagger to see the example data.

Example Use Cases

  • A conference hall might have a list of vendors that will be presenting on a given date. To ensure easy navigation back and forth between the map and the information page, you can create a lookup table, fetching the MapsIndoors External ID's with GET /{apiKey}/api/geodata, and the conference hall's own database. The Integration API would allow this functionality to be easily implemented.
  • Some of our clients have used the Integration API to create their own CMS, for example, using POST /{apiKey}/api/geodata to create new desk locations in the Solution for their corporate offices.
  • You can use PUT /{apiKey}/api/displaytypes to edit multiple Location Types at once. For example, if you want to have some Location Types only show up at certain times of day, or when other conditions are met.
  • An airport might want the various routes to change based on estimated wait times in queues. This can be done by using the Integration API to connect to a live data feed of client's positioning in the airport, and using GET /{apiKey}/api/routing/routeelements and PUT /{apiKey}/api/routing/routeelements, setting a given Route Element to "Blocked" if too many people are there.

The last example about airport wait times will be expanded upon briefly, giving slighly more detailed explanations on how to achieve such an implementation.

  • The API calls can read or update the backend content, whereas the SDK only reads it. Therefore, the act of making the API calls are not part of the app, but part of a seperate backend service outside of MapsIndoors.
  • Use GET /{apiKey}/api/routing/routeelements to fetch the list of route elements used in your solution, and their information structure. This should return a JSON file like this, with appropriate values instead of string or 0:
[
{
"id": "string",
"datasetId": "string",
"externalId": "string",
"geometry": {
"type": 0
},
"restrictions": [
"string"
],
"onewayDirection": 0,
"waitTime": 0
}
]
  • Use an integration with a third-party sensor system to detect the amount of people present throughout the airport, on the paths of the given routes fetched earlier.
  • Use PUT /{apiKey}/api/routing/routeelements to update the information of the route elements, changing the restrictions parameter to locked if there are too many people on a given route. An example of this request body could be:
[
{
"id": "string",
"datasetId": "string",
"externalId": "string",
"geometry": {
"type": 0
},
"restrictions": [
"locked"
],
"onewayDirection": 0,
"waitTime": 0
}
]

The other information needed, such as the ID's, can be found in the GET call made earlier.

  • Next time the SDK fetches information, it will load some routes as locked or "Blocked". This will cause the route generation to avoid these specific paths, helping to alleviate the congestion.

Login and Credentials

First, log in to the service to get an access token to access the data.

This requires a POST request to our Auth API at the following endpoint: https://auth.mapsindoors.com/connect/token

The Auth API supports multiple ways to log in. The most common way is with your MapsIndoors username and password. If you need to sign in with other providers, please contact support. No matter what login method you use, you will always need to use the following content-type header when talking to the Auth API:

Content-Type: application/x-www-form-urlencoded

Log in with MapsIndoors Username/Password

To log in with your MapsIndoors login, send them with the grant_type set to password.

Use the following key/value set:

grant_type: password
client_id: client
username: <your username>
password: <your password>

Replacing <your username> and <your password> with your own credentials, and leaving grant_type and client_id as stated above.

The body of the request must end up containing a query string like this:

grant_type=password&client_id=client&username=<your username>&password=<your password>

When You Are Authenticated

If you sent valid credentials to the Auth API, you will receive a response like this:

{
"access_token": "eyJhbGciOiJ...vmERrovsg",
"expires_in": 86400,
"token_type": "Bearer",
"scope": "integration"
}

You will need the value from the key access_token for all your requests to the Integration API by adding the Authorization header like this:

authorization: Bearer eyJhbGciOiJ...vmERrovsg

Note: The access token is valid for 24 hours. After that you will need to reauthenticate, following the same steps as explained above.