ThingTweet App
(To be removed) Link your
Warning
The ThingTweet app will be removed in a future release. Use the Alerts API instead. See Version History.
Use the ThingTweet app to link a
Associate Twitter Account with ThingSpeak Account
If you are logged in to a
Sign In to
ThingSpeak .Select Apps > ThingTweet.
Click Link Twitter Account.
You are redirected to
Twitter . When asked to authorize ThingTweet to use your account:Enter your
Twitter username and password.Click Authorize app.
After you confirm the
Twitter account, click the link Back to ThingTweet to return to the ThingTweet App page.Notice that your
Twitter account is now linked to ThingSpeak
The app generates a ThingTweet API Key for you to use. Use this
API key and a message to send a request to ThingTweet. The message
gets relayed to
Update Twitter Status
To update your
Title | HTTP Request to Update |
---|---|
URL | https://api.thingspeak.com/apps/thingtweet/1/statuses/update |
HTTP Method | POST or GET |
POST HTTP Header | X-THINGSPEAKAPIKEY=XXXXXXXXXXXXXXX |
Data Parameters | api_key=XXXXXXXXXXXXXXX |
Success Response | 1 |
Error Responses | –1 |
Sample POST HTTP Call | POST /apps/thingtweet/1/statuses/update |
Sample GET HTTP Call | https://api.thingspeak.com/apps/thingtweet/1/statuses/update?api_key=XXXXXXXXXXXXXXXX&status=HeyWorld |
Notes | ThingTweet API key must appear in either the HTTP header or in the body section of the POST, or it can appear in both |
Example POSTMAN Request
You can use POSTMAN to try out your HTTP requests using the RESTful API for ThingSpeak. Select the Body of the request as x-www-form-urlencoded. Test the tweet request by configuring POSTMAN as shown.
Update Twitter Status with Last Value from Channel
You can include channel data in your "%%channel_CHANNEL-ID_field_FIELD-NUMBER%%"
with the last value of the specified channel
and field. To update your field1
, send an HTTP POST.
Title | HTTP
POST Request to Update |
---|---|
URL | https://api.thingspeak.com/apps/thingtweet/1/statuses/update |
HTTP Method | POST |
HTTP Header | X-THINGSPEAKAPIKEY=XXXXXXXXXXXXXXX |
Data Parameters | api_key=XXXXXXXXXXXXXXXX |
Success Response | 1 |
Error Responses | –1 |
Sample HTTP Call | POST /apps/thingtweet/1/statuses/update |
Notes | ThingTweet API key must appear in either the HTTP header or in the body section, or it can appear in both |
Example POSTMAN Request
You can use POSTMAN to try out your HTTP requests using the RESTful API for ThingSpeak. Test the tweet request using POSTMAN and configuring as shown.
To update a channel and simultaneously post a tweet from your device, see Write Data.
Replacement Keys
You can pass data to your apps using replacement keys. The following table summarizes the standard and custom replacement keys you can use. Some keys are specific to a particular type of request, as indicated in the last column.
Key | Description | Example | Use With |
---|---|---|---|
%%YOUR_CUSTOM_LABEL%% | ThingHTTP replaces this custom replacement value with data in the trigger request that has the label "YOUR_CUSTOM_LABEL". | field1=%%YOUR_CUSTOM_LABEL%% POST data: YOUR_CUSTOM_LABEL=1234 .RESULT: field1=1234 . | Any request |
%%channel_CHANNEL_ID_ | The last value of the specified channel and field. Replacement requests to private channels not owned by the same user as the ThingHTTP request return blank values. | The latest value is %%channel_12_field_1%%.RESULT: The latest value is 2.5. | Any request |
%%datetime%% | The full date and time when the TimeControl or React ran. | The date and time the event occurred is %%datetime%%.RESULT: The date and time the event occurred is 2014-09-24 5:32 p.m. | TimeControl or React |
%%day%% | The name of the weekday when TimeControl ran. | The day the event occurred is %%day%%.RESULT: The day the event occurred is
Wednesday. | TimeControl |
%%day_index%% | The zero-based index of the weekday starting on Sunday. | The number of days used this week is %%day_index%%.RESULT: The number of days used
this week is 3. | TimeControl |
%%hour%% | The hour of the day when TimeControl ran. | The hour that the event occurred is %%hour%%.RESULT: The hour that the event occurred is 5. | TimeControl |
%%minute%% | The minute of the hour when the TimeControl ran. | The minute the event occurred is %%minute%%.RESULT: The minute the event occurred is
30. | TimeControl |
%%trigger%% | The value that triggered React. | It is way too hot in here at %%trigger%% C .RESULT: It is way too hot in here at 40 C . | React |
%%channel_id%% | The channel ID that triggered React. | The channel that triggers is %%channel_id%%.RESULT: The channel that
triggers is 1256. | React |
Version History
June 2024: Errors
The ThingTweet app will be removed in a future release. Using the ThingTweet app results in an error. As an alternative you can use the Alerts API.