ThingHTTP

Updated ThingSpeak Documentation is now located in ThingSpeak Docs. For support, use the ThingSpeak Forum.

 
The ThingHTTP App allows a micrcontroller or low-level device to connect to any web service using HTTP over a network or Internet. You create an HTTP object using the ThingHTTP App and then control the object with simple API commands. ThingHTTP supports GET, POST, PUT, and DELETE methods, SSL, Basic Authentication, custom hostname, custom headers, different content types, and the 1.0 and 1.1 versions of HTTP. With this app, you can have a device interface with many web services and APIs such as Prowl and Twilio without having to implementing the protocol on the device level.

ThingHTTP Request URL

[cce]http://api.thingspeak.com/apps/thinghttp/send_request[/cce]

Replacements

The ThingHTTP request can have placeholders for data to be replaced when the request is sent. To make a replacement, enclose the replacement name in %% signs in the ThingHTTP Body form field.  An example Body field might look like:
from=thingspeak&message=%%message%%
Then, pass the name of the replacement in the API request as a parameter, without the enclosing %% signs.

Example HTTP POST

POST /apps/thinghttp/send_request HTTP/1.1
Host: api.thingspeak.com
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: (number of characters in message)api_key=(thinghttp_api_key)&message=hello+world

Parse String

ThingHTTP sends back the full response that is generated by the request. If you are looking to extract a piece of data from the response, you can add a Parse String to the ThingHTTP Request. This feature allows you to do the parsing on the ThingSpeak side instead of wasting code space on the device / microcontroller side. The format is Parent_cell.child_cell etc. If you also know the full XPATH to the data, you can specify the XPATH as the Parse String.

ThingHTTP Tutorials

5 comments

  1. Is there a new tutorial on how to parse data out of a page returned by ThingHTTP? The google weather one no longer works..

    1. We’re working on improving our documentation to make parsing data from ThingHTTP clearer. In the meantime, is there a specific ThingHTTP request you’d like me to help out with parsing data?

  2. Hey there! I have a small question, but firstly I’ve been getting into your site/service in the last few days and I love it, a lot of fun trying different combinations of things out. I’ve been able to read off an Arduino UNO really easily and the results are pretty great, thanks for providing such and awesome API.
    What I would love to know how to do is CONTROL the UNOs functions with ThingSpeak but for the life of me I can’t find a place to start, I understand that thingHTTP might be one of the first places to start but can you point me in the right direction for some functionality like the Gum Ball machine that was posted?
    Thanks very much, Andrew

  3. for some time now i am trying to make my http request triggered but with out success!!!! do not know what i am doing wrong. if i do it directly pointing to the iobridge it works!!!!. can some one guide me please
    regards

Comments are closed.