Main Content

Get Last Executed TalkBack Command

Get last executed TalkBack command from TalkBack queue

Request

HTTP Method

GET

URL

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

Input Arguments

NameDescription

<talkback_id>

(Required) TalkBack ID, specified as a positive integer.

<format>

Format for the HTTP response, specified as json or xml.

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

Query String Parameters

NameDescriptionValue Type
api_key

(Required) API key for this specific instance of TalkBack. The Talkback key is different from the channel and user API keys.

string

Content-Type

application/x-www-form-urlencoded

Response

Success

HTTP Status Code

200 OK

Body

Leave <format> blank to receive the response in text format.

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

Sample Response

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

Response

{
  "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

Response

<?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>

Error

If there are no commands that have been executed for this instance of TalkBack, the request will return HTTP status code 404 and error_resource_not_found.

For the full list, see Error Codes.