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 Channel Information

Channel information includes channel description, field names, channel location, metadata, public or private status, and the name of the channel. To update channel, send an HTTP PUT to https://api.thingspeak.com/channels/CHANNEL_ID, replacing CHANNEL_ID with the ID of the channel.

Valid parameters:

  • api_key (string) - User’s API key. This is different than a channel API key, and can be found in your profile page. (required).

  • description (string) - Description of the channel (optional)

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

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

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

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

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

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

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

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

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

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

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

  • metadata (text) - Metadata for the channel, which can include JSON, XML, or any other data (optional)

  • name (string) - Name of the channel (optional)

  • public_flag (true/false) - Whether the channel is public, default false (optional)

  • tags (string) - Comma-separated list of tags (optional)

  • url (string) - Webpage URL for the channel (optional)

JSON

To update a channel, send an HTTP PUT to https://api.thingspeak.com/channels/CHANNEL_ID.json, replacing CHANNEL_ID with the ID of the channel.

Example PUT:

PUT https://api.thingspeak.com/channels/4.json
    api_key=XXXXXXXXXXXXXXXX
    name=Updated Channel

The response is a JSON object of the updated channel, for example:

{
  "id": 4,
  "name": "Updated Channel",
  "description": null,
  "metadata": null,
  "latitude": null,
  "longitude": null,
  "created_at": "2014-03-25T13:12:50-04:00",
  "elevation": null,
  "last_entry_id": null,
  "ranking": 15,
  "username": "iothans",
  "tags": [],
  "api_keys":
  [
    {
      "api_key": "XXXXXXXXXXXXXXXX",
      "write_flag": true
    }
  ]
}

XML

To update a channel, send an HTTP PUT to https://api.thingspeak.com/channels/CHANNEL_ID.xml, replacing CHANNEL_ID with the ID of the channel.

Example PUT:

PUT https://api.thingspeak.com/channels/4.xml
    api_key=XXXXXXXXXXXXXXXX
    name=Updated Channel

The response is an XML object of the updated channel, for example:

<?xml version="1.0" encoding="UTF-8"?>
<channel>
    <id type="integer">4</id>
    <name>Updated Channel</name>
    <description nil="true" />
    <metadata nil="true" />
    <latitude type="decimal" nil="true" />
    <longitude type="decimal" nil="true" />
    <created-at type="dateTime">2014-03-25T20:17:44-04:00</created-at>
    <elevation nil="true" />
    <last-entry-id type="integer" nil="true" />
    <ranking type="integer">15</ranking>
    <username>iothans</username>
    <tags type="array" />
    <api-keys type="array">
        <api-key>
            <api-key>XXXXXXXXXXXXXXXX</api-key>
            <write-flag type="boolean">true</write-flag>
        </api-key>
    </api-keys>
</channel>

Related Topics

Was this topic helpful?