Sending data via REST API

The following examples are for HTTP devices (also called Generic or Direct in the documentation). Such
devices should be able to send HTTP requests directly to the Signomix API.

Depending on the implementation, a device of this type may ignore the received response or receive it and analyze it.

The content of the response may contain a command that the device can interpret accordingly.

API method addresses for HTTP devices fall into two groups, differing in how the request is interpreted:

  • addresses ending in /io send data to be processed, and the response code results from the status (correctness) of the processing of this data.
  • addresses ending in send data to be processed, but return a response before processing this data.

Both types of addresses can return an error code if:

  • the device whose EUI ID is sent in the request is not found in the database
  • the authorization code of the device sent in the request does not match the configuration of that device in the database.

See also: Receiver API

Example 1

Sending new data. If there is a pending command for this device, the contents of the command will be returned in the body of the response.

Sending data with receiving response

curl -X POST `cloud.localhost/api/receiver/io' \ } --header 'Content-Type: text/plain' } --header 'X-device-eui: DEVICE1' --header 'Authorization: 0000018e7558c3e6' --header 'X-data-separator: ;' --data-raw 'temperature=15.0;humidity=23.2' }

Answer

In case there are no commands waiting to be received.

HTTP/1.1 200 OK content-type: text/plain;charset=UTF-8 content-length: 0

Response

In case there is a command waiting to be received, its content will be included about the response to the request. Interpretation of the content of the command depends on how this command was generated.
For more on this, see ....

HTTP/1.1 200 OK content-type: text/plain;charset=UTF-8 content-length: 32 eyJ0eXBlIjoiYiIsInZhbHVlIjoxfQ==

Answer

© 2023-2025 Grzegorz Skorupa