Difference between revisions of "API Channels List"
(→Optional Paramaters) |
|||
(3 intermediate revisions by one user not shown) | |||
Line 50: | Line 50: | ||
| [[API Channel Fields]] | | [[API Channel Fields]] | ||
| List of comma separated fields to be returned in the response. | | List of comma separated fields to be returned in the response. | ||
+ | |- | ||
+ | | page | ||
+ | | 1 | ||
+ | | Depends on query | ||
+ | | Integer | ||
+ | | The current pages to display based on the limit. | ||
|- | |- | ||
| url_time_limit | | url_time_limit | ||
Line 70: | Line 76: | ||
| array of [[API Channel Fields]] | | array of [[API Channel Fields]] | ||
| List of channels | | List of channels | ||
+ | |- | ||
+ | | page | ||
+ | | integer | ||
+ | | The current viewed page of results. | ||
+ | |- | ||
+ | | per-page | ||
+ | | integer | ||
+ | | The maximum number of results to return per page. | ||
+ | |- | ||
+ | | total-pages | ||
+ | | integer | ||
+ | | The total number of pages that exist. | ||
+ | |- | ||
+ | | total-entries | ||
+ | | integer | ||
+ | | The total number of entries found from all pages. | ||
|- | |- | ||
| result_length | | result_length | ||
| integer | | integer | ||
− | | Total number of results that | + | | Total number of results that have been returned on this page. This may differ from the per-page/limit value on the last page. |
|} | |} | ||
Line 112: | Line 134: | ||
], | ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 100, | ||
+ | “total-pages” : 1 | ||
+ | “total-entries” : 2, | ||
+ | “result_length” : 2 | ||
} | } | ||
</blockquote> | </blockquote> | ||
Line 141: | Line 167: | ||
</channel> | </channel> | ||
</channels> | </channels> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">100</per-page”> | ||
+ | <total-pages type="integer">1</total-pages> | ||
+ | <total-entries type="integer">2</total-entries> | ||
<result-length type="integer">2</result-length> | <result-length type="integer">2</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
Line 203: | Line 233: | ||
], | ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 100, | ||
+ | “total-pages” : 1 | ||
+ | “total-entries” : 4, | ||
+ | “result_length” : 4 | ||
} | } | ||
</blockquote> | </blockquote> | ||
Line 254: | Line 288: | ||
</channel> | </channel> | ||
</channels> | </channels> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">100</per-page”> | ||
+ | <total-pages type="integer">1</total-pages> | ||
+ | <total-entries type="integer">4</total-entries> | ||
<result-length type="integer">4</result-length> | <result-length type="integer">4</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
Line 301: | Line 339: | ||
], | ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 2, | ||
+ | “total-pages” : 2 | ||
+ | “total-entries” : 4, | ||
+ | “result_length” : 2 | ||
} | } | ||
</blockquote> | </blockquote> | ||
Line 330: | Line 372: | ||
</channel> | </channel> | ||
</channels> | </channels> | ||
− | <result-length type="integer"> | + | <page type="integer">1</page> |
+ | <per-page” type="integer">2</per-page”> | ||
+ | <total-pages type="integer">2</total-pages> | ||
+ | <total-entries type="integer">4</total-entries> | ||
+ | <result-length type="integer">2</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
</hash> | </hash> | ||
Line 365: | Line 411: | ||
} ], | } ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 100, | ||
+ | “total-pages” : 1 | ||
+ | “total-entries” : 1, | ||
+ | “result_length” : 1 | ||
} | } | ||
</blockquote> | </blockquote> | ||
Line 387: | Line 437: | ||
</channel> | </channel> | ||
</channels> | </channels> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">100</per-page”> | ||
+ | <total-pages type="integer">1</total-pages> | ||
+ | <total-entries type="integer">1</total-entries> | ||
<result-length type="integer">1</result-length> | <result-length type="integer">1</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> |
Latest revision as of 10:00, 29 November 2013
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 | 100 | 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. | |
page | 1 | Depends on query | Integer | The current pages to display based on the limit. |
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 |
page | integer | The current viewed page of results. |
per-page | integer | The maximum number of results to return per page. |
total-pages | integer | The total number of pages that exist. |
total-entries | integer | The total number of entries found from all pages. |
result_length | integer | Total number of results that have been returned on this page. This may differ from the per-page/limit value on the last page. |
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 |
|
All channels on the account accessible by the user, returning all fields
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
fields | id,name,url,logo_url,type,updated_at,created_at |
JSON |
---|
http://api.unroole.com/accounts/1/channels.json?token=1f0qpLwoV5oIcfnU2yvO&fields=id,name,url,logo_url,type,updated_at,created_at |
|
XML |
---|
http://api.unroole.com/accounts/1/channels.xml?token=1f0qpLwoV5oIcfnU2yvO&fields=id,name,url,logo_url,type,updated_at,created_at |
|
Return 2 results using search term "test"
result_length is 3 because there are 3 channels that can be returned, but the user requested only for 2
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
limit | 2 |
search | test |
JSON |
---|
http://api.unroole.com/accounts/1/channels.json?token=1f0qpLwoV5oIcfnU2yvO&limit=2&search=test |
|
XML |
---|
http://api.unroole.com/accounts/1/channels.xml?token=1f0qpLwoV5oIcfnU2yvO&limit=2&search=test |
|
Search for type "Website"
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
search | Website |
JSON |
---|
http://api.unroole.com/accounts/1/channels.json?token=1f0qpLwoV5oIcfnU2yvO&search=Website |
|
XML |
---|
http://api.unroole.com/accounts/1/channels.xml?token=1f0qpLwoV5oIcfnU2yvO&search=Website |
|