本文へスキップ

Remote Command HTTP/S Usage

With Remote Command, you can use the Soracom User Console and the Soracom API to send HTTP or HTTPS commands to devices that use IoT SIMs and verify the...

コピー/保存

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

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

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

英語版を見る

Sending HTTP/S Commands to a Device

With Remote Command, you can use the Soracom User Console and the Soracom API to send HTTP or HTTPS commands to devices that use IoT SIMs and verify their results.

Prepare your device: ! Set up your device in advance so that it will execute any process triggered by an HTTP request and return the result of that process as an HTTP response.

From the User Console

  1. Sign in to the User Console . From the Menu, open the SIM Management screen.

  2. From the list of subscribers, click the **** for the SIM you want to send an HTTP/S command to.

  3. Click the **Actions ** menu, then select Send Command via HTTP/S.

  4. Configure the following settings:

    Send Command via HTTP
    SettingDescription
    ProtocolSelect the protocol that the device accepts requests on.
    PortSpecify the port number that the device accepts requests on. Example: 80, 443
    PathSpecify the URL path. Do not include the hostname. Example: /path/to/resource
    MethodSelect the HTTP method.
    HeadersAdd to add multiple HTTP headers.
    BodyIf you select POST, PUT, or DELETE in Method, enter the request body to send.
  5. Click Send.

    An HTTP request (command) is sent to the device. When the command execution is complete on the device, the HTTP response (command execution result) is displayed.

Programmatic Usage

Soracom API

To access the Soracom API, first use the auth API to obtain an API Key and Token. Refer to the API Usage Guide for instructions on how to use the API Key and Token in API requests.

Then, use the sendDownlinkHttp API to send an HTTP request to a device that has an IoT SIM:

curl -X POST \
|  -H 'X-Soracom-API-Key: <MY-API-KEY>' \
|  -H 'X-Soracom-Token: <MY-TOKEN>' \
|  -H 'Content-Type: application/json' \
|  -d '{
|        "method": "POST",
|        "path": "/command/settings",
|        "port": 6443,
|        "skipVerify": false,
|        "ssl": true,
|        "headers": {
|          "Content-Type": "application/json"
|        },
|        "body": "{\"param1\":\"value1\", \"param2\":\"value2\"}",
|      }' \
|  https://g.api.soracom.io/v1/sims/<SIM_ID>/downlink/http
curl -X POST \
|  -H 'X-Soracom-API-Key: <MY-API-KEY>' \
|  -H 'X-Soracom-Token: <MY-TOKEN>' \
|  -H 'Content-Type: application/json' \
|  -d '{
|        "method": "POST",
|        "path": "/command/settings",
|        "port": 6443,
|        "skipVerify": false,
|        "ssl": true,
|        "headers": {
|          "Content-Type": "application/json"
|        },
|        "body": "{\"param1\":\"value1\", \"param2\":\"value2\"}",
|      }' \
|  https://jp.api.soracom.io/v1/sims/<SIM_ID>/downlink/http

Soracom CLI

To use the Soracom CLI, you must first configure it to authenticate with your account information, authorization key, or SAM user credentials.

Run the following command to send an HTTP request to a device that has an IoT SIM:

body='{
|        "method": "POST",
|        "path": "/command/settings",
|        "port": 6443,
|        "skipVerify": false,
|        "ssl": true,
|        "headers": {
|          "Content-Type": "application/json"
|        },
|        "body": "{\"param1\":\"value1\", \"param2\":\"value2\"}"
|      }'
soracom sims downlink-http --sim-id <SIM_ID> --body ${body} --coverage-type g
body='{
|        "method": "POST",
|        "path": "/command/settings",
|        "port": 6443,
|        "skipVerify": false,
|        "ssl": true,
|        "headers": {
|          "Content-Type": "application/json"
|        },
|        "body": "{\"param1\":\"value1\", \"param2\":\"value2\"}"
|      }'
soracom sims downlink-http --sim-id <SIM_ID> --body ${body} --coverage-type jp
検索 Escで閉じる / Enterで検索結果