137 lines
3.7 KiB
Plaintext
137 lines
3.7 KiB
Plaintext
|
<div>
|
||
|
<%= render 'response' %>
|
||
|
<h2 id="list_user_channels">List User's Channels</h2>
|
||
|
</div>
|
||
|
|
||
|
<br>
|
||
|
To get a list of a user's Channels, send an HTTP GET to <code><%= @ssl_api_domain %>users/<span class="customcode">USERNAME</span>/channels<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||
|
replacing <span class="customcode">USERNAME</span> with the person's username.
|
||
|
|
||
|
<br><br>
|
||
|
Valid parameters:
|
||
|
<ul>
|
||
|
<li><b>api_key</b> (string) - User's API Key which, if provided, will also show private channels. (optional)</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
Example GET:
|
||
|
|
||
|
<pre>
|
||
|
GET <span class="str"><%= @ssl_api_domain %>users/hans/channels<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span>
|
||
|
</pre>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
<div class="format format-block-xl format-text">
|
||
|
The response will be a webpage with a list of the user's Channels.
|
||
|
</div>
|
||
|
|
||
|
<div class="format format-block-xl format-json">
|
||
|
The response will be a JSON object of the user's Channels, for example:
|
||
|
|
||
|
<pre class="prettyprint">
|
||
|
{
|
||
|
"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": "hans",
|
||
|
"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": "hans",
|
||
|
"tags":
|
||
|
[
|
||
|
{
|
||
|
"id": 9,
|
||
|
"name": "temp"
|
||
|
},
|
||
|
{
|
||
|
"id": 25,
|
||
|
"name": "light"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
</pre>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
<div class="format format-block-xl format-xml">
|
||
|
The response will be an XML object of the user's Channels, for example:
|
||
|
|
||
|
<pre class="prettyprint">
|
||
|
<?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>hans</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>hans</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>
|
||
|
</pre>
|
||
|
|
||
|
</div>
|
||
|
|