Main Content

Add TalkBack Command

Add TalkBack command to TalkBack queue

Request

HTTP Method

POST

URL

https://api.thingspeak.com/talkbacks/<talkback_id>/commands.<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

Body 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

command_string

Command to be sent to your device. Each command_string is limited to 255 characters.

string

position

(Optional) The position you want the command to appear in. Any previous commands at or after this position are shifted down. If the position is left blank, the command is automatically added to the end of the queue with the highest position.

integer

Content-Type

application/x-www-form-urlencoded

Response

Success

HTTP Status Code

200 OK

Body

 Text Example

 JSON Example

 XML Example

Error

For the full list, see Error Codes.

Examples

expand all

You can use POSTMAN to try out your HTTP requests using the RESTful API for ThingSpeak. This example shows how to add a TalkBack command to an existing queue using POSTMAN.

Add the TalkBack command LIGHTON to an existing TalkBack queue with the TalkBack ID 24507.

POST https://api.thingspeak.com/talkbacks/24507/commands
     api_key=YOUR_TALKBACK_API_KEY
     command_string=LIGHTON

  1. In POSTMAN, select POST from the drop-down list of HTTP verbs, and enter https://api.thingspeak.com/talkbacks/TALKBACK_ID/commands in the address bar. Change TALKBACK_ID to your TalkBack ID.

  2. Enter the parameter api_key and your TalkBack API key, which is found in Apps > TalkBack> YOUR TALKBACK NAME.

  3. Enter the additional parameters and values:

    • api_key, Value: XXXXXXXXXXXXXXXX

    • command_string, Value: LIGHTON

The response is in text format. Note the server response value of 200 OK, which indicates the successful addition of the command to your TalkBack queue.

The new command is now available in your TalkBack queue.