Mapping REST API (beta)

General

Endpoint https://mapping-api.indooratlas.com/public/v1

A valid IndoorAtlas Mapping API key is required. During the Beta program, please contact IndoorAtlas Support to get api key.

Api key is given either with header X-API-Key: myapikey in the request, or as query parameter key=myapikey in the url.

Example requests: 

curl -H 'X-API-Key: myapikey' https://mapping-api.indooratlas.com/public/v1/floorplans/12345678-90ab-cdef-1234-567890abcdef/paths/geojson 

curl https://mapping-api.indooratlas.com/public/v1/floorplans/12345678-90ab-cdef-1234-567890abcdef/paths/geojson?key=myapikey

Error responses

  • 401 - the provided api key or URL is not valid
  • 50x - an unexpected error occurred

Venue API

List venues

GET /venues

List all venues.

Response

Example:



[
    {
        "id": "venueId1",
        "name": "venue1",
        "coordinates": {
            "lat": 60.1672065,
            "lon": 24.943796
        }
    },
    {
        "id": "venueId2",
        "name": "venue2",
        "coordinates": {
            "lat": 61.1672065,
            "lon": 25.943796
        }
    }
]

Floor plans for a venue

GET /venues/[venueId]/floorplans

List floor plans for a venue.

Parameters

  • venueId (required) - venue ID

Response

  • 404 - venue not found

Example:

[
    {
        "id": "floorPlanId1",
        "venueId": "venueId1",
        "name": "floorPlan1",
        "floorNumber": 1,
        "image": {
            "url": "https://example.com/image",
            "width": 1000,
            "height": 1000,
            "widthMeters": 100,
            "heightMeters": 100,
            "metersToPixels": 10,
            "pixelsToMeters": 0.1,
            "center": {
                "lat": 60.1672065,
                "lon": 24.943796
            },
            "bearing": 42,
            "topLeft": {
                "lat": 60.1672065,
                "lon": 24.943796
            },
            "topRight": {
                "lat": 60.1672065,
                "lon": 24.943796
            },
            "bottomLeft": {
                "lat": 60.1672065,
                "lon": 24.943796
            },
            "bottomRight": {
                "lat": 60.1672065,
                "lon": 24.943796
            }
        }
    }
]

NOTE! The image urls may expire and change between requests. Do not count on them to work indefinitely. See also https://docs.indooratlas.com/positioning-api#/components/schemas/FloorPlan

Paths API (Fingerprinting paths)

Paths for a floor plan

GET /floorplans/[floorPlanId]/paths/geojson[?onlyEnabled=false]

Get currently enabled paths for a floor plan as GeoJSON.

Path parameters

  • floorPlanId (required) - floor plan ID

Query parameters

  • onlyEnabled (optional) - set to false if also disabled paths should be returned. By default only enabled paths are returned.

Single path

GET /floorplans/[floorPlanId]/paths/[pathId]/geojson

Get a single path as GeoJSON.

Parameters

  • floorPlanId (required) - floor plan ID
  • pathId (required) - path ID (same as recording ID)

Response

Floor plan paths as GeoJSON. When single path is requested, just one GeoJSON feature object is returned.

Properties

  • enabled (boolean) - whether path is enabled or disabled

Example:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "id": "01783152-aa0b-45ef-acf7-9e0223e0bf06",
            "properties": {
                "enabled": true
            },
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [
                        24.930503757329896,
                        60.16800268895112
                    ],
                    [
                        24.930505818301488,
                        60.168003564669778
                    ],
                    [
                        24.93050753343344,
                        60.168004462408529
                    ]
                ]
            }
        },
        {
            "type": "Feature",
            "id": "097dac6f-6083-4408-ab04-a610a53253b7",
            "properties": {
                "enabled": false
            },
            "geometry": {
                "type": "LineString",
                "coordinates": [
                    [
                        24.93045572961841,
                        60.16790095232539
                    ],
                    [
                        24.93045934773496,
                        60.16790194612099
                    ],
                    [
                        24.930462980979685,
                        60.16790306418164
                    ]
                ]
            }
        }
    ]
}

Disable or enable a path

POST /floorplans/[floorPlanId]/paths/[pathId]/disable

or

POST /floorplans/[floorPlanId]/paths/[pathId]/enable

Parameters

  • floorPlanId (required) - floor plan ID
  • pathId (required) - path ID (same as recording ID)

Response

  • 200 - path was successfully disabled/enabled
  • 404 - floor plan or path not found

Map generation API

Generate map for a floor plan

POST /floorplans/[floorPlanId]/generate_map

Start map generation for a floor plan.

Parameters

  • floorPlanId (required) - floor plan ID

Response

  • 200 - new map generation was triggered
  • 204 - map generation was NOT triggered - no changes were detected
  • 409 - map generation was NOT triggered - map is already being generated
  • 422 - map generation was NOT triggered - no mapping data is available

Map analytics API

Get analytics image overlays for latest generated map

GET /floorplans/[floorPlanId]/analytics/latest_map

Parameters

  • floorPlanId (required) - floor plan ID

Response

  • 404 - floor plan not found or latest map not yet generated

Example:

{
    "floorPlanId": "floorPlanId1",
    "analyticsImageUrls": {
        "magneticMappingQuality": "https://example.com/image/MagneticMappingQuality.png",
        "wifiMappingQuality": "https://example.com/image/WifiMappingQuality.png",
        "wifiEnvironmentQuality": "https://example.com/image/WifiEnvironmentQuality.png",
        "beaconEnvironmentQuality": "https://example.com/image/BeaconEnvironmentQuality.png"
    }
}

NOTE! The analytics images may have reduced width/height compared to the floor plan image, but preserve the aspect ratio. NOTE! The image urls may expire and change between requests. Do not count on them to work indefinitely.