Contenu principal

Cette page a été traduite par traduction automatique. Cliquez ici pour voir la dernière version en anglais.

List Your Public Channels

Liste des canaux pour le nom d'utilisateur avec HTTP GET

Requête

Méthode HTTP

GET

URL

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

Paramètres d'URL

NomDescription

<user_id>

(Obligatoire) ID utilisateur pour les canaux qui vous intéressent.

<format>

(Obligatoire) Format de la réponse HTTP, spécifié comme json ou xml.

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

Paramètres de la chaîne de requête

NomDescriptionType de valeur
tag

(Facultatif) Spécifiez une balise à rechercher dans les canaux publics.

chaîne de caractère

Réponse

Succès

Code HTTP status

200 OK

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

La réponse est un tableau JSON de paramètres de canal , par exemple :

{
"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": 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 réponse est un tableau XML de paramètres de canal , par exemple :

<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">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>

Erreur

Pour la liste complète, voir Codes d'erreur.