Difference between revisions of "API Channels List"
Tommy.leung (Talk | contribs) |
Tommy.leung (Talk | contribs) |
||
Line 74: | Line 74: | ||
| integer | | integer | ||
| Total number of results that '''could''' be returned. This may not be the number of channels in the response, as it is truncated by ''limit'' parameter. | | Total number of results that '''could''' be returned. This may not be the number of channels in the response, as it is truncated by ''limit'' parameter. | ||
+ | |} | ||
+ | |||
+ | == Examples == | ||
+ | |||
+ | === All channels on the account accessible by the user === | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Parameters | ||
+ | ! Values | ||
+ | |- | ||
+ | | token | ||
+ | | 1f0qpLwoV5oIcfnU2yvO | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/2/channels.json?token=1f0qpLwoV5oIcfnU2yvO</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | { | ||
+ | "channels" : [ | ||
+ | { "id" : 5, | ||
+ | "logo_url" : <nowiki>"https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/5/original/opo9941a.jpg"</nowiki>, | ||
+ | "name" : "another sample channel", | ||
+ | "type" : "Mobile Briefcase", | ||
+ | "url" : <nowiki>"http://anothersamplechannel-sample.unroole.com"</nowiki> | ||
+ | }, | ||
+ | { "id" : 4, | ||
+ | "logo_url" : <nowiki>"https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/4/original/heic0709b.jpg"</nowiki>, | ||
+ | "name" : "samplechannel", | ||
+ | "type" : "Mobile Briefcase", | ||
+ | "url" : <nowiki>"http://samplechannel-sample.unroole.com"</nowiki> | ||
+ | } | ||
+ | ], | ||
+ | "http_status" : 200, | ||
+ | "result_length" : 2 | ||
+ | } | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! XML | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/2/channels.xml?token=1f0qpLwoV5oIcfnU2yvO</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <hash> | ||
+ | <channels type="array"> | ||
+ | <channel> | ||
+ | <id type="integer">5</id> | ||
+ | <name>another sample channel</name> | ||
+ | <type>Mobile Briefcase</type> | ||
+ | <url><nowiki>http://anothersamplechannel-sample.unroole.com</nowiki></url> | ||
+ | <logo-url><nowiki>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/5/original/opo9941a.jpg</nowiki></logo-url> | ||
+ | </channel> | ||
+ | <channel> | ||
+ | <id type="integer">4</id> | ||
+ | <name>samplechannel</name> | ||
+ | <type>Mobile Briefcase</type> | ||
+ | <url><nowiki>http://samplechannel-sample.unroole.com</nowiki></url> | ||
+ | <logo-url><nowiki>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/4/original/heic0709b.jpg</nowiki></logo-url> | ||
+ | </channel> | ||
+ | </channels> | ||
+ | <result-length type="integer">2</result-length> | ||
+ | <http-status type="integer">200</http-status> | ||
+ | </hash> | ||
+ | </blockquote> | ||
|} | |} |
Revision as of 09:09, 18 June 2012
Contents
Summary
Allows querying for a list of channels belonging to the account. The query is a wildcard search on:
- name
- type
URI
https://api.unroole.com/accounts/[account-id]/channels
HTTP Method
GET
Required Paramaters
Paramater | Default | Maximum Length | Accepted Values | Description |
---|---|---|---|---|
token | API Persistence Token that identifies this user and its permissions. |
Optional Paramaters
Paramater | Default | Maximum Length | Accepted Values | Description |
---|---|---|---|---|
search | string | The search terms to be used in the query. | ||
limit | TBD | The maximum number of channels to return. | ||
fields | id, name, type, url, logo_url | API Channel Fields | List of comma separated fields to be returned in the response. | |
url_time_limit | 60 | The length of time (in seconds) that the asset url will be accessible for. This only applies to the response. |
Response
Field | Type | Description |
---|---|---|
http_status | integer | API Status Code http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html |
error | Rails default | |
accounts | array of API Channel Fields | List of channels |
result_length | integer | Total number of results that could be returned. This may not be the number of channels in the response, as it is truncated by limit parameter. |
Examples
All channels on the account accessible by the user
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
JSON |
---|
http://api.unroole.com/accounts/2/channels.json?token=1f0qpLwoV5oIcfnU2yvO |
|
XML |
---|
http://api.unroole.com/accounts/2/channels.xml?token=1f0qpLwoV5oIcfnU2yvO |
|