本文へスキップ
Docs
English日本語
ログイン

このページはまだ日本語では利用できません。現在は英語版を表示しています。ブラウザの翻訳機能をご利用ください。

ブラウザで翻訳する
  • Chrome / Edge: アドレスバーの翻訳アイコン、またはページを右クリックして「日本語に翻訳」を選択してください。
  • Safari: アドレスバーの「aA」メニューから「翻訳」を選択してください。

翻訳メニューが表示されない場合は、ブラウザ設定で翻訳機能が有効になっているか確認してください。

英語版を見る

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]

検索 Escで閉じる / Enterで検索結果