このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
ユーザーとチャネル
ユーザー情報の取得
テキスト
ユーザーの情報を取得するには、以下に HTTP GET を送信します。
https://api.thingspeak.com/users/USERNAME
USERNAME
を情報の取得対象のユーザーのユーザー名で置き換えます。オプション パラメーター
api_key (文字列): ユーザーのアカウント API キーを入力します。API キーを入力するとユーザーのプライベート情報 (電子メール アドレスなど) が表示されます。ThingSpeak™ アカウントにログイン済みのブラウザーを使用する場合、プライベート情報が表示され、ユーザー API キーを追加する必要はありません。
例. HTTP GET を送信してユーザーの情報を表示します。ファイル拡張子を指定しないでください。
GET https://api.thingspeak.com/users/iothans
応答はユーザーに関する情報をもつ Web ページです。
JSON
ユーザーの情報を取得するには、以下に HTTP GET を送信します。
https://api.thingspeak.com/users/USERNAME.json
USERNAME
を情報の取得対象のユーザーのユーザー名で置き換えます。次に例を示します。
GET https://api.thingspeak.com/users/iothans.json
応答はユーザーの JSON オブジェクトです。次に例を示します。
{ "id": 4, "login": "iothans", "created_at": "2010-12-03T09:17:52-05:00", "bio": "Web Developer @iobridge, @thingspeak", "website": "http://www.iamshadowlord.com" }
MathWorks® アカウント ユーザーの場合、Web サイトは MWA コミュニティのプロファイル ページになります。
XML
ユーザーの情報を取得するには、以下に HTTP GET を送信します。
https://api.thingspeak.com/users/USERNAME.xml
USERNAME
を情報の取得対象のユーザーのユーザー名で置き換えます。次に例を示します。
GET https://api.thingspeak.com/users/iothans.xml
応答はユーザーの XML オブジェクトです。次に例を示します。
<?xml version="1.0" encoding="UTF-8"?> <user> <id type="integer">4</id> <login>iothans</login> <created-at type="dateTime">2010-12-03T09:17:52-05:00</created-at> <bio>Web Developer @iobridge, @thingspeak</bio> <website>http://www.iamshadowlord.com</website> </user>
ユーザーのチャネルをリスト
テキスト
ユーザーのチャネルのリストを取得するには、以下に HTTP GET を送信します。
https://api.thingspeak.com/users/USERNAME/channels
USERNAME
を、リスト対象のチャネルのユーザーのユーザー名で置き換えます。オプション パラメーター
api_key (文字列): ユーザーのアカウント API キーを入力します。ユーザー API キーを指定するとプライベート チャネルが表示されます。
例. HTTP GET を送信してチャネルをリストします。
GET https://api.thingspeak.com/users/iothans/channels
応答は指定したユーザー チャネルのリストをもつ Web ページです。
JSON
ユーザーのチャネルのリストを取得するには、以下に HTTP GET を送信します。
https://api.thingspeak.com/users/USERNAME/channels.json
USERNAME
を、リスト対象のチャネルのユーザーのユーザー名で置き換えます。オプション パラメーター
api_key (文字列): ユーザーのアカウント API キーを入力します。ユーザー API キーを指定するとプライベート チャネルが表示されます。
例. HTTP GET を送信してチャネルをリストします。
GET https://api.thingspeak.com/users/iothans/channels.json
応答は、指定したユーザー チャネルの JSON オブジェクトです。次に例を示します。
{ "channels": [ { "id": 3, "name": "ioBridge Server", "description": "ioBridge IO-204 connected to web server", "latitude": null, "longitude": null, "created_at": "2010-12-03T09:26:23-05:00", "elevation": "", "last_entry_id": 163690, "ranking": 85, "username": "iothans", "tags": [ { "id": 24, "name": "temperature" } ] }, { "id": 9, "name": "my_house", "description": "Netduino Plus connected to sensors around the house", "latitude": "40.44", "longitude": "-79.996", "created_at": "2010-12-13T20:20:06-05:00", "elevation": "", "last_entry_id": 6062844, "ranking": 100, "username": "iothans", "tags": [ { "id": 9, "name": "temp" }, { "id": 25, "name": "light" } ] } ] }
XML
ユーザーのチャネルのリストを取得するには、以下に HTTP GET を送信します。
https://api.thingspeak.com/users/USERNAME/channels.xml
USERNAME
を、リスト対象のチャネルのユーザーのユーザー名で置き換えます。オプション パラメーター
api_key (文字列): ユーザーのアカウント API キーを入力します。ユーザー API キーを指定するとプライベート チャネルが表示されます。
例. HTTP GET を送信してチャネルをリストします。
GET https://api.thingspeak.com/users/iothans/channels.xml
応答は、指定したユーザー チャネルの XML オブジェクトです。次に例を示します。
<?xml version="1.0" encoding="UTF-8"?> <response> <channels type="array"> <channel> <id type="integer">3</id> <name>ioBridge Server</name> <description>ioBridge IO-204 connected to web server</description> <latitude nil="true"/> <longitude nil="true"/> <created-at type="dateTime">2010-12-03T09:26:23-05:00</created-at> <elevation/> <last-entry-id type="integer">163690</last-entry-id> <ranking type="integer">85</ranking> <username>iothans</username> <tags type="array"> <tag> <id type="integer">24</id> <name>temperature</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.996</longitude> <created-at type="dateTime">2010-12-13T20:20:06-05:00</created-at> <elevation/> <last-entry-id type="integer">6062860</last-entry-id> <ranking type="integer">100</ranking> <username>iothans</username> <tags type="array"> <tag> <id type="integer">9</id> <name>temp</name> </tag> <tag> <id type="integer">25</id> <name>light</name> </tag> </tags> </channel> </channels> </response>