Is there an API for creating room layouts?

There is a programmatic way to create a room layout with “Location Builder” in iOS, but is there a way to do this with an API endpoint so an iPhone app doesn’t have to be created?

The Indoor Location Wizard is barely useable, and can only make a rectangle.

The Location Builder is pretty much just a front for this API endpoint:

https://cloud.estimote.com/docs/#api-IndoorGroup-AddIndoorLocation

Granted, it’s not very well documented, but the example request shown in there is pointing in the right direction :slight_smile:

When I copy that example request in to Insomnia and send it, I get this error:

{ "message": "Internal Server Error" }

Here is the curl output of my request:

curl --request POST \
  --url https://cloud.estimote.com/v1/indoor/locations \
  --header 'authorization: Basic (Insomnia basic auth with app ID and token generated by Estimote Android code generator "doctracker-dy7)' \
  --header 'content-type: application/json' \
  --data '(exact JSON body copied from https://cloud.estimote.com/docs/#api-IndoorGroup-AddI )'

When I cut the JSON body down to just the name, public and orientation fields, I get this error:

{ "message": "The location needs at least 3 walls" }

Which implies that it’s at least understanding some of the input.

When I cut the JSON down to just those three fields mentioned above, and add the walls, I still get Internal Server Error.

When I try the Get all locations request with the same app ID and token, I get an empty JSON list: [], so the request and authentication seem to be working without issue.

Can you post an example that you’ve confirmed actually works?

Could you get the team to add more context around these error messages?

I realized that Estimote might not like the fact that I don’t own the beacons mentioned in the JSON, so I changed one of the beacon’s mac fields to the UUID of one of my beacons, and I’m still getting Internal Server Error.

Here is the JSON body of the request, which is verbatim from the Add indoor location example, with all of the beacons removed and replaced with my own beacon:

{
    "name": "Example location",
    "public": false,
    "orientation": 23.5,
    "walls": [
        {
            "x1": 0,
            "y1": 0,
            "x2": 0,
            "y2": 5,
            "orientation": 90
        },
        {
            "x1": 0,
            "y1": 5,
            "x2": 7,
            "y2": 5,
            "orientation": 180
        },
        {
            "x1": 7,
            "y1": 5,
            "x2": 9,
            "y2": -2,
            "orientation": 254.054604099077
        },
        {
            "x1": 9,
            "y1": -2,
            "x2": 4,
            "y2": 0,
            "orientation": 21.8014094863518
        },
        {
            "x1": 4,
            "y1": 0,
            "x2": 0,
            "y2": 0,
            "orientation": 0
        }
    ],
    "beacons": [
        {
            "beacon": {
                "mac": "fa1bd33ef090cc4a1091e4316b47b110"
            },
            "position": {
                "x": 5,
                "y": 2,
                "orientation": 0
            }
        }
    ],
    "linear_objects": [
        {
            "x1": 1,
            "y1": 0,
            "x2": 3,
            "y2": 0,
            "orientation": 0,
            "type": 1
        },
        {
            "x1": 0,
            "y1": 1,
            "x2": 0,
            "y2": 2,
            "orientation": 90,
            "type": 0
        }
    ],
    "pins": [
        {
            "x": 1,
            "y": 0,
            "orientation": 0,
            "name": "Downhill bike",
            "type": "bike"
        },
        {
            "x": 1,
            "y": -1,
            "orientation": 100,
            "name": "My chair",
            "type": "furniture"
        }
    ]
}