ThingSpeak

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Update a Channel Feed

To update a channel feed, send an HTTP GET or POST to https://api.thingspeak.com/update.

Valid parameters:

  • api_key (string) - Write API key for this specific channel (required). The Write API key can optionally be sent via a THINGSPEAKAPIKEY HTTP header.

  • field1 (string) - Field 1 data (optional)

  • field2 (string) - Field 2 data (optional)

  • field3 (string) - Field 3 data (optional)

  • field4 (string) - Field 4 data (optional)

  • field5 (string) - Field 5 data (optional)

  • field6 (string) - Field 6 data (optional)

  • field7 (string) - Field 7 data (optional)

  • field8 (string) - Field 8 data (optional)

  • lat (decimal) - Latitude in degrees (optional)

  • long (decimal) - Longitude in degrees (optional)

  • elevation (integer) - Elevation in meters (optional)

  • status (string) - Status update message (optional)

  • twitter (string) - Twitter® username linked to ThingTweet (optional)

  • tweet (string) - Twitter status update (optional)

  • created_at (datetime) - Date when this feed entry was created, in ISO 8601 format, for example: 2014-12-31 23:59:59. Time zones can be specified via the timezone parameter (optional)

Text

Example POST:

POST https://api.thingspeak.com/update
     api_key=XXXXXXXXXXXXXXXX
     field1=73

The response is the entry ID of the update, for example: 18.

If the update fails, the response is 0.

JSON

To update a channel feed, send an HTTP GET or POST to https://api.thingspeak.com/update.json.

Example POST:

POST https://api.thingspeak.com/update.json
     api_key=XXXXXXXXXXXXXXXX
     field1=73

The response is a JSON object of the new feed, for example:

{
  "channel_id": 3,
  "field1": '73',
  "field2": null,
  "field3": null,
  "field4": null,
  "field5": null,
  "field6": null,
  "field7": null,
  "field8": null,
  "created_at": '2014-02-25T14:13:01-05:00',
  "entry_id": 320,
  "status": null,
  "latitude": null,
  "longitude": null,
  "elevation": null
}

XML

To update a channel feed, send an HTTP GET or POST to https://api.thingspeak.com/update.xml.

Example POST:

POST https://api.thingspeak.com/update.xml
     api_key=XXXXXXXXXXXXXXXX
     field1=73

The response is an XML object of the new feed, for example:

<?xml version="1.0" encoding="UTF-8"?>
<feed>
  <channel-id type="integer">3</channel-id>
  <field1>73</field1>
  <field2 nil="true"/>
  <field3 nil="true"/>
  <field4 nil="true"/>
  <field5 nil="true"/>
  <field6 nil="true"/>
  <field7 nil="true"/>
  <field8 nil="true"/>
  <created-at type="dateTime">2014-02-25T14:15:42-05:00</created-at>
  <entry-id type="integer">321</entry-id>
  <status nil="true"/>
  <latitude type="decimal" nil="true"/>
  <longitude type="decimal" nil="true"/>
  <elevation nil="true"/>
</feed>

Related Topics

Was this topic helpful?