Skip to main content
Docs
English日本語
Login

Collect Data from an Inventory Device with Harvest Data

Devices managed by Inventory can easily send any arbitrary data to Harvest Data for data collection and visualization. Sending data is performed using the So…

Devices managed by Inventory can easily send any arbitrary data to Harvest Data for data collection and visualization. Sending data is performed using the Soracom API, and is authenticated using the device ID and secret key.

Because a device will send data using the Soracom API rather than one of Harvest Data's entry points, data collection from Inventory devices can be done without using a Soracom Air cellular connection.

Send Data to Harvest Data

Since data is sent to Harvest Data using the Soracom API, simply use an HTTP GET or POST request.

First, ensure that your device belongs to a group, and that Harvest Data has been enabled for that group.

Then, use one of the following methods:

  • Using GET (method 1):

[ui-tabs theme=code] [ui-tab title=Global]

curl -X GET \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  https://g.api.soracom.io/v1/devices/<DEVICE-ID>/publish?temp=20

[/ui-tab] [ui-tab title=Japan]

curl -X GET \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  https://jp.api.soracom.io/v1/devices/<DEVICE-ID>/publish?temp=20

[/ui-tab] [/ui-tabs]

  • Using GET (method 2), where the secret key is URL-encoded:

[ui-tabs theme=code] [ui-tab title=Global]

curl -X GET \
|  https://g.api.soracom.io/v1/devices/<DEVICE-ID>/publish?device_secret=<URL-ENCODED-SECRET-KEY>&temp=20

[/ui-tab] [ui-tab title=Japan]

curl -X GET \
|  https://jp.api.soracom.io/v1/devices/<DEVICE-ID>/publish?device_secret=<URL-ENCODED-SECRET-KEY>&temp=20

[/ui-tab] [/ui-tabs]

  • Using POST:

[ui-tabs theme=code] [ui-tab title=Global]

curl -X POST \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  -d '{
|        "temp": 20
|      }' \
|  https://g.api.soracom.io/v1/devices/<DEVICE-ID>/publish

[/ui-tab] [ui-tab title=Japan]

curl -X POST \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  -d '{
|        "temp": 20
|      }' \
|  https://jp.api.soracom.io/v1/devices/<DEVICE-ID>/publish

[/ui-tab] [/ui-tabs]

Search Esc to close / Enter to view results