Contenido principal

Esta página se ha traducido mediante traducción automática. Haga clic aquí para ver la última versión en inglés.

List Your Public Channels

Listar canales para nombre de usuario con HTTP GET

Pedido

Método HTTP

GET

URL

https://api.thingspeak.com/users/<user_id>/channels.<format>

Parámetros de URL

NombreDescripción

<user_id>

(Obligatorio) ID de usuario para los canales de interés.

<format>

(Obligatorio) Formato para la respuesta HTTP, especificado como json o xml.

Ejemplo: https://api.thingspeak.com/users/cstapels/channels.json

Parámetros de cadena de consulta

NombreDescripciónTipo de valor
tag

(Opcional) Especifique una etiqueta para buscar en canales públicos.

cadena

Respuesta

Éxito

Código de estado HTTP

200 OK

Cuerpo
GET https://api.thingspeak.com/users/iothans/channels.json

La respuesta es una matriz JSON de configuraciones de canal, por ejemplo:

{
"channels": [
{
"id": 3,
"name": "ioBridge Server",
"description": "ioBridge IO-204 connected to web server to report temperatures to ThingSpeak",
"latitude": "0.0",
"longitude": "0.0",
"created_at": "2010-12-03T14:26:23Z",
"elevation": "",
"last_entry_id": 365190,
"public_flag": true,
"url": "https://www.iobridge.com",
"ranking": 85,
"tags": [
{
"id": 24,
"name": "temperature"
},
{
"id": 317,
"name": "iobridge"
}
]
},
{
"id": 9,
"name": "my_house",
"description": "Netduino Plus connected to sensors around the house",
"latitude": "40.44",
"longitude": "-79.9965",
"created_at": "2010-12-14T01:20:06Z",
"elevation": "",
"last_entry_id": 13541195,
"public_flag": true,
"url": "https://nothans.com/thingspeak-building-my-own-twitter-for-things",
"ranking": 100,
"tags": [
{
"id": 9,
"name": "temp"
},
{
"id": 25,
"name": "light"
},
{
"id": 3,
"name": "sensor"
}
]
},
{
"id": 212,
"name": "Digital Step Demo",
"description": "",
"latitude": "0.0",
"longitude": "0.0",
"created_at": "2011-03-29T20:05:20Z",
"elevation": "",
"last_entry_id": 8,
"public_flag": true,
"url": "",
"ranking": 15,
"tags": []
}
]
}
GET https://api.thingspeak.com/users/iothans/channels.xml

La respuesta es una matriz XML de configuraciones de canal, por ejemplo:

<response>
<channels type="array">
<channel>
<id type="integer">3</id>
<name>ioBridge Server</name>
<description>
ioBridge IO-204 connected to web server to report temperatures to ThingSpeak
</description>
<latitude type="decimal">0.0</latitude>
<longitude type="decimal">0.0</longitude>
<created-at type="dateTime">2010-12-03T14:26:23Z</created-at>
<elevation/>
<last-entry-id type="integer">365191</last-entry-id>
<public-flag type="boolean">true</public-flag>
<url>https://www.iobridge.com</url>
<ranking type="integer">85</ranking>
<tags type="array">
<tag>
<id type="integer">24</id>
<name>temperature</name>
</tag>
<tag>
<id type="integer">317</id>
<name>iobridge</name>
</tag>
</tags>
</channel>
<channel>
<id type="integer">9</id>
<name>my_house</name>
<description>
Netduino Plus connected to sensors around the house
</description>
<latitude type="decimal">40.44</latitude>
<longitude type="decimal">-79.9965</longitude>
<created-at type="dateTime">2010-12-14T01:20:06Z</created-at>
<elevation/>
<last-entry-id type="integer">13541215</last-entry-id>
<public-flag type="boolean">true</public-flag>
<url>
https://nothans.com/thingspeak-building-my-own-twitter-for-things
</url>
<ranking type="integer">100</ranking>
<tags type="array">
<tag>
<id type="integer">9</id>
<name>temp</name>
</tag>
<tag>
<id type="integer">25</id>
<name>light</name>
</tag>
<tag>
<id type="integer">3</id>
<name>sensor</name>
</tag>
</tags>
</channel>
<channel>
<id type="integer">212</id>
<name>Digital Step Demo</name>
<description/>
<latitude type="decimal">0.0</latitude>
<longitude type="decimal">0.0</longitude>
<created-at type="dateTime">2011-03-29T20:05:20Z</created-at>
<elevation/>
<last-entry-id type="integer">8</last-entry-id>
<public-flag type="boolean">true</public-flag>
<url/>
<ranking type="integer">15</ranking>
<tags type="array"/>
</channel>
</response>

Error

Para obtener la lista completa, consulte Códigos de error.