Tags commissioning

Tags commissioning

1. Adding a tag

A tag can be created by sending a POST request to /api/v2/sites/{SITE_ID}/nao_trackables. The SITE_ID will be provided by Pole Star after the deployment of the site.

NAO Cloud REST API – Add a tag

If SITE_ID is 12061 and the auth_token is UNyCernxjUHR18Rx1Qy7XGDyAdVksqDf8W, we can create a tag using the following HTTP request (the MAC address should be provided using the AA:BB:CC:11:22:33 format):

 

POST /api/v2/sites/12061/nao_trackables
HTTP/1.1Content-Type: application/json
Accept: application/json
Authorization: UNyCernxjUHR18Rx1Qy7XGDyAdVksqDf8W

{
  "nao_trackable": {
    "name": "My tag",
    "tracking_id": "AA:BB:CC:44:55:66",
  }
}

 

If the requested resource has been created successfully, the server will return a 201 Created status code, along with the resource details in the JSON body. An auto-assigned ID will always be returned in the JSON body, which enables the client to interact with the individual resource later on, e.g: tag deletion.

In case of error in the request, a 422 Unprocessable Entity is returned.

 

2. Adding tags in batch

A tag can be created by sending a POST request to /api/v2/sites/{SITE_ID}/nao_trackables/batch. The SITE_ID will be provided by Pole Star after the deployment of the site.

If SITE_ID is 220 and the auth_token is <AUTH_TOKEN>, we can commission multiple tags at the same time using the following HTTP request:

Curl request:

curl -X PUT -H “Content-Type: application/json” –header ‘Accept: application/vnd.api+json’ –header ‘Authorization: <AUTH_TOKEN>’ ‘https://www.nao-cloud.com/api/v2/sites/11719/nao_trackables/batch’ -d ‘{“nao_trackables”: [{ “name”: “1”, “tracking_id”: “11:23:45:67:89:AB” }, { “name”: “2”, “tracking_id”: “22:23:45:67:89:AB” }]}’

Warning: The tags created using this API will overwrite any existing tags no the NAO Cloud site, use this API carefully.

If the requested resource has been created successfully, the server will return a 201 Created status code, along with the resource details in the JSON body. An auto-assigned ID will always be returned in the JSON body, which enables the client to interact with the individual resource later on, e.g: tag deletion.

In case of error in the request, a 422 Unprocessable Entity is returned.

 

3. Removing a tag

A tag can be deleted by sending a DELETE request to /api/v2/sites/{SITE_ID}/nao_trackables/{ID}.

The SITE_ID will be provided by Pole Star after the deployment of the site.

The ID can be NAO_TRACKABLE_ID or NAO_TRACKABLE_TRACKING_ID.

The NAO_TRACKABLE_ID is the auto-assigned ID returned during tag creation (request describe earlier in the document).

The NAO_NAO_TRACKABLE_TRACKING_ID is the BLE MAC address of the tag.

NAO® Cloud REST API, remove a tag

 

The server will return a 204 No Content status code if a deletion request is successful and no content is returned. A 404 Not Found might be returned if the resource does not exist.

    • Related Articles

    • Getting meta-data on tags, zones and alerts

      Tags The meta-data of tags can be retrieved via the REST API. Only users with one of the following roles can access the tracking REST API: Site creator Site admin Tracking manager The API authentication token is used for authentication, it can be ...
    • Overview

      NAO Cloud provides APIs for 3rd party software to get information in real time.There are 2 main APIs, Location API and Monitoring API. Each API corresponds to a MQTT topic that a software can subscribe to receive information. The Location API returns ...
    • Release 24.09 (NAOSDK 4.11.17)

      Versions Component Version NAO® Cloud 24.09 NAO® Viewer 24.09 NAO® SDK iOS 4.11.17 NAO® SDK Android 4.11.17 NAO® Logger iOS 4.11.17 NAO® Logger Android 4.11.17 New Features NAO® Cloud Location history: added new controls on the NAO Cloud history ...
    • BLE beaconing interoperability – Basic guidelines

      The NAO Suite is designed to be interoperable with 3rd party BLE beacons and tags. This page aims at providing a first layer of interoperability requirements to ease the compatibility assessment with beacons & tags vendors. Disclaimer: This list is a ...
    • Location API

      Overview Location API can be used to receive location information about all tags of a given site. Once subscribed to a topic, your application will receive MQTT messages. Each message contains a topic and a payload. Refer ot the “Connection and ...