4. Fetching Data

4. Fetching Data

Data, including resources and relationships, can be fetched by sending a GET request to an endpoint. The server responds to a successful request to fetch an individual resource or resource collection with a 200 OK response.

404 Not found will be returned if a request fetches a single resource that does not exist. The response body will have a errors node with details. A 200 OK response will be returned if a request fetches a empty resource collection. The response body will be a JSON with a root node and an empty JSON array.

For instance, all sites of the authenticated user might be fetched with the following request:

GET /api/v2/sites HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: UNyCernxjUHR18Rx1Qy7XGDyAdVksqDf8w

{
    "sites": []
}
    • Related Articles

    • Working offline – embed data files

      Some files are needed to use the NAO SDK Services in your app: app.json: for general service configuration and geofencing alerts definition. Only one file is required per API Key, no matter the number of NAO Cloud sites covered by this API Key. ...
    • 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 ...
    • Sample code

      The following code shows an example of how to infer the floor information from the altitude of a location update, and convert the (lat, lon) coordinates to pixel (x, y) to ease display on an image map. 1 import matplotlib.pyplot as plt 2 import ...
    • Sample code

      The following code shows an example of how to infer the floor information from the altitude of a location update, and convert the (lat, lon) coordinates to pixel (x, y) to ease display on an image map. 1 import matplotlib.pyplot as plt 2 import ...
    • List of URLs used by the SDK

      Required SDK URLs Please ensure that your network allows access to the following URLs for full functionality of the SDK: For european customers: URL Description URL for Production Environment URL for Staging Environment Distribution URL to download ...