メインコンテンツ

このページは機械翻訳を使用して翻訳されました。最新版の英語を参照するには、ここをクリックします。

Get Last Executed TalkBack Command

TalkBackキューから最後に実行されたTalkBackコマンドを取得します

要求

HTTPメソッド

GET

URL

https://api.thingspeak.com/talkbacks/<talkback_id>/commands/last.<format>

入力引数

名前説明

<talkback_id>

(必須) TalkBack ID。正の整数として指定します。

<format>

HTTP 応答の形式。json または xml として指定されます。

例: https://api.thingspeak.com/talkbacks/12345/commands/last.json

クエリ文字列パラメーター

名前説明値のタイプ
api_key

(必須) TalkBackのこの特定のインスタンスの API キー。Talkback キーは、チャネルおよびユーザー API キーとは異なります。

string

Content-Type

application/x-www-form-urlencoded

応答

成功

HTTPステータスコード

200 OK

Body

応答をテキスト形式で受け取るには、<format> を空白のままにしておきます。

GET https://api.thingspeak.com/talkbacks/12345/commands/last?api_key==XXXXXXXXXXXXXXXX

サンプルレスポンス

OPENDOOR
GET https://api.thingspeak.com/talkbacks/12345/commands/last.json?api_key=XXXXXXXXXXXXXXXX

応答

{
  "command_string": "OPENDOOR",
  "created_at": "2018-12-29T17:53:40-05:00",
  "executed_at": "2018-12-30T17:53:40-05:00",
  "id": 2446323,
  "position": null
}
GET https://api.thingspeak.com/talkbacks/12345/commands/last.xml?api_key=XXXXXXXXXXXXXXXX

応答

<?xml version="1.0" encoding="UTF-8"?>
<command>
  <id type="integer">2446323</id>
  <command-string>OPENDOOR</command-string>
  <position type="integer" nil="true"/>
  <created-at type="datetime">2013-12-30T16:51:17-05:00</created-at>
  <executed-at type="datetime">2013-12-31T16:51:17-05:00</executed-at>
</command>

エラー

TalkBackのこのインスタンスに対して実行されたコマンドがない場合、要求は HTTP ステータス コード 404 と error_resource_not_found を返します。

完全なリストについては、エラーコード を参照してください。