Write Settings
Update channel settings with HTTP PUT
Request
Description
Use this request to write channel settings. Channel settings include channel description, field names, channel location, metadata, public or private status, and the name of the channel.
HTTP Method
PUT
URL
https://api.thingspeak.com/channels/
<channel_id>
.<format>
URL Parameters
Name | Description |
---|---|
| (Required) Channel ID for the channel of interest. |
| (Required) Format for the HTTP response, specified as
|
Example:
https://api.thingspeak.com/channels/266256.json
Body Parameters
Name | Description | Value Type |
---|---|---|
api_key | (Required) Specify User API Key, which you can find in your profile. This key is different from the channel API keys. | string |
description | (Optional) Description of the channel. | string |
field1 | (Optional) Field 1 name. | string> |
field<X> | (Optional) Field X name, where X is the field ID. | string |
latitude | (Optional) Latitude in degrees, specified as a value
between | decimal |
longitude | (Optional) Longitude in degrees, specified as a value
between | decimal |
elevation | (Optional) Elevation in meters. | integer |
metadata | (Optional) Metadata for the channel, which can include JSON, XML, or any other data. | text |
name | (Optional) Name of the channel. | string |
public_flag | (Optional) Whether the channel is public. The default is false. | true or false |
tags | (Optional) Comma-separated list of tags. | string |
url | (Optional) Webpage URL for the channel. | string |
Content-Type
application/x-www-form-urlencoded
Response
Error
For the full list, see Error Codes.
Examples
Use POSTMAN to Write Channel Settings
You can use POSTMAN to try out your HTTP requests using the RESTful API for ThingSpeak. This example shows how to write new channel settings using POSTMAN.
Using an existing channel, change the channel name to Updated
Channel
and the field 1 title to Heart
Rate
. Also change the sharing to Public.
PUT https://api.thingspeak.com/channels/CHANNEL_ID api_key=XXXXXXXXXXXXXXXX name=Updated Channel public_flag=true field1=Heart Rate
In POSTMAN, select PUT from the drop-down list of HTTP verbs and enter
api.thingspeak.com/channels/<CHANNEL_ID>.json
in the address bar, replacing<CHANNEL_ID>
with the channel of interest.Enter the parameter
api_key
in the value column, enter your User API Key, which is found in Account > My Profile.Enter additional parameters and values:
name
, Value:Updated Channel
field1
, Value:Heart Rate
public_flag
, Value:True
The response is in JSON format. Note the server response value of 200 OK, indicating successful writing of new channel settings.
The new channel settings are now available on your channels page.