RESTFUL
This page explains how the user can send their devices' data through the Airtrace REST API.
Rest APIs
Representational state transfer (REST) is a software architectural style that describes a uniform interface between physically separate components, often across the Internet in a Client-Server architecture. REST defines four interface constraints:
Identification of resources
Manipulation of resources
Self-descriptive messages and
hypermedia as the engine of application state
Sending data through restful links
How to upload
When the user infrastructure is generated, links are provided for each sensor, a link is just an alphanumeric string that comprises part of the URL path where a specific sensor will upload their data.
The link should follow the api base base url when uploading, and most importantly the sensor must include the user's API key when uploading data for it to be transmitted successfully.
As a last remark, the data must be included in the body of the POST request, in json format and containing only one property: "data".
Example
When a user is provided with a link for each sensor during infrastructure generation, they should take note of whichever link corresponds to whichever sensor.
If the link that is associated to sensor "sensor_A" is "ABC", the the sensor must upload it's data to the url: api.airtrace.io/v1/infrastructure/ABC via a POST request and providing the API key with the request.
Last updated