本文へスキップ

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 t...

コピー/保存

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

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

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

英語版を見る

Data Collection 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 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):
curl -X GET \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  https://g.api.soracom.io/v1/devices/<DEVICE-ID>/publish?temp=20
curl -X GET \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  https://jp.api.soracom.io/v1/devices/<DEVICE-ID>/publish?temp=20
  • Using GET (method 2), where the secret key is URL-encoded:
curl -X GET \
|  https://g.api.soracom.io/v1/devices/<DEVICE-ID>/publish?device_secret=<URL-ENCODED-SECRET-KEY>&temp=20
curl -X GET \
|  https://jp.api.soracom.io/v1/devices/<DEVICE-ID>/publish?device_secret=<URL-ENCODED-SECRET-KEY>&temp=20
  • Using POST:
curl -X POST \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  -d '{
|        "temp": 20
|      }' \
|  https://g.api.soracom.io/v1/devices/<DEVICE-ID>/publish
curl -X POST \
|  -H 'X-Device-Secret: <SECRET-KEY>' \
|  -d '{
|        "temp": 20
|      }' \
|  https://jp.api.soracom.io/v1/devices/<DEVICE-ID>/publish
検索 Escで閉じる / Enterで検索結果