Skip to main content

/admin/pair: Pair Location

POST 

/admin/pair

What

This method allows devices to be connected to specific locations within the system. It also allows the creation of new locations.

You can provide the entire structure of your locations. If you have a nested structure like Building -> Floor -> Room, you need to provide all three levels in the correct hierarchy. [buildingObject, floorObject, roomObject]

An example of a two level hierarchy can be found in the code example section.

The devices/client/users will be linked at the location their mentioned at. So you can provide a hierarchy and link devices at any level. Most of the time only the last level will get a client/user/device assigned.

To pair a location, you can either:

  • Provide a ClientId (sensor); the system will automatically link all devices of that sensor to the location.
  • Provide a list of DeviceSerialIDs to link specific devices to the location.
  • Provide a userName to link the location to the devices of that user.

If you provide multiple options from the list above, the system will attempt to link all devices it finds.

If you provide a userName and the user is connected via multiple sensors, all devices from all sensors will be linked. Use this option with caution.

It is recommended to provide only one of the options above and to use the userName option only if you are certain that the user is using a single sensor.

Location type

Each level may state a locationType: 0 = place (a single workplace), 1 = room (a container such as a room, floor or building). Use 1 to pair area-wide devices — a default gateway or a Wi-Fi BSSID — to the room itself instead of to a workplace inside it.

The field is optional and only ever applies to levels this call creates: a location that already exists keeps its type. When it is omitted, a new level is typed by its position — the last level becomes a place, every level above it a room.

Who

Account administrators of the account (and higher).

Login

Login, API key or Sensor signature (all allowed).

Request​

Responses​

OK