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.
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.
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.
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.
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.