Summary
Allows querying for a list of channels belonging to the account. The query is a wildcard search on:
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
|
{
"channels" : [
{ "id" : 5,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/5/original/opo9941a.jpg",
"name" : "another sample channel",
"type" : "Mobile Briefcase",
"url" : "http://anothersamplechannel-sample.unroole.com"
},
{ "id" : 4,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/4/original/heic0709b.jpg",
"name" : "samplechannel",
"type" : "Mobile Briefcase",
"url" : "http://samplechannel-sample.unroole.com"
}
],
"http_status" : 200,
“page” : 1,
“per-page” : 100,
“total-pages” : 1
“total-entries” : 2,
“result_length” : 2
}
|
XML
|
http://api.unroole.com/accounts/2/channels.xml?token=1f0qpLwoV5oIcfnU2yvO
|
<hash>
<channels type="array">
<channel>
<id type="integer">5</id>
<name>another sample channel</name>
<type>Mobile Briefcase</type>
<url>http://anothersamplechannel-sample.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/5/original/opo9941a.jpg</logo-url>
</channel>
<channel>
<id type="integer">4</id>
<name>samplechannel</name>
<type>Mobile Briefcase</type>
<url>http://samplechannel-sample.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/4/original/heic0709b.jpg</logo-url>
</channel>
</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>
<http-status type="integer">200</http-status>
</hash>
|
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
|
{ "channels" : [
{ "created_at" : "2012-06-14T17:47:31Z",
"id" : 1,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/1/original/opo0501a.jpg",
"name" : "testchannel",
"type" : "Mobile Briefcase",
"updated_at" : "2012-06-14T17:47:31Z",
"url" : "http://testchannel-testaccount.unroole.com"
},
{ "created_at" : "2012-06-15T19:24:15Z",
"id" : 2,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/2/original/opo0110a.jpg",
"name" : "testchannel2",
"type" : "Mobile Briefcase",
"updated_at" : "2012-06-15T19:24:15Z",
"url" : "http://testchannel2-testaccount.unroole.com"
},
{ "created_at" : "2012-06-15T19:24:57Z",
"id" : 3,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/3/original/opo9912a.jpg",
"name" : "testchannel3",
"type" : "Mobile Briefcase",
"updated_at" : "2012-06-15T19:24:57Z",
"url" : "http://testchannel3-testaccount.unroole.com"
},
{ "created_at" : "2012-06-18T13:22:36Z",
"id" : 7,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/7/original/qrcode.234073.png",
"name" : "promotions",
"type" : "Website",
"updated_at" : "2012-06-18T13:22:36Z",
"url" : "http://promotions-testaccount.unroole.com"
}
],
"http_status" : 200,
“page” : 1,
“per-page” : 100,
“total-pages” : 1
“total-entries” : 4,
“result_length” : 4
}
|
XML
|
http://api.unroole.com/accounts/1/channels.xml?token=1f0qpLwoV5oIcfnU2yvO&fields=id,name,url,logo_url,type,updated_at,created_at
|
<hash>
<channels type="array">
<channel>
<id type="integer">1</id>
<name>testchannel</name>
<type>Mobile Briefcase</type>
<url>http://testchannel-testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/1/original/opo0501a.jpg</logo-url>
<created-at type="datetime">2012-06-14T17:47:31Z</created-at>
<updated-at type="datetime">2012-06-14T17:47:31Z</updated-at>
</channel>
<channel>
<id type="integer">2</id>
<name>testchannel2</name>
<type>Mobile Briefcase</type>
<url>http://testchannel2-testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/2/original/opo0110a.jpg</logo-url>
<created-at type="datetime">2012-06-15T19:24:15Z</created-at>
<updated-at type="datetime">2012-06-15T19:24:15Z</updated-at>
</channel>
<channel>
<id type="integer">3</id>
<name>testchannel3</name>
<type>Mobile Briefcase</type>
<url>http://testchannel3-testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/3/original/opo9912a.jpg</logo-url>
<created-at type="datetime">2012-06-15T19:24:57Z</created-at>
<updated-at type="datetime">2012-06-15T19:24:57Z</updated-at>
</channel>
<channel>
<id type="integer">7</id>
<name>promotions</name>
<type>Website</type>
<url>http://promotions-testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/7/original/qrcode.234073.png</logo-url>
<created-at type="datetime">2012-06-18T13:22:36Z</created-at>
<updated-at type="datetime">2012-06-18T13:22:36Z</updated-at>
</channel>
</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>
<http-status type="integer">200</http-status>
</hash>
|
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
|
{ "channels" : [
{ "id" : 1,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/1/original/opo0501a.jpg",
"name" : "testchannel",
"type" : "Mobile Briefcase",
"url" : "http://testchannel-testaccount.unroole.com"
},
{ "id" : 2,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/2/original/opo0110a.jpg",
"name" : "testchannel2",
"type" : "Mobile Briefcase",
"url" : "http://testchannel2-testaccount.unroole.com"
}
],
"http_status" : 200,
“page” : 1,
“per-page” : 100,
“total-pages” : 1
“total-entries” : 2,
“result_length” : 2
}
|
XML
|
http://api.unroole.com/accounts/1/channels.xml?token=1f0qpLwoV5oIcfnU2yvO&limit=2&search=test
|
<hash>
<channels type="array">
<channel>
<id type="integer">1</id>
<name>testchannel</name>
<type>Mobile Briefcase</type>
<url>http://testchannel-testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/1/original/opo0501a.jpg</logo-url>
</channel>
<channel>
<id type="integer">2</id>
<name>testchannel2</name>
<type>Mobile Briefcase</type>
<url>http://testchannel2-testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/2/original/opo0110a.jpg</logo-url>
</channel>
</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>
<http-status type="integer">200</http-status>
</hash>
|
Search for type "Website"
Parameters
|
Values
|
token
|
1f0qpLwoV5oIcfnU2yvO
|
search
|
Website
|
JSON
|
http://api.unroole.com/accounts/1/channels.json?token=1f0qpLwoV5oIcfnU2yvO&search=Website
|
{ "channels" : [
{ "id" : 7,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/7/original/qrcode.234073.png",
"name" : "promotions",
"type" : "Website",
"url" : "http://promotions-testaccount.unroole.com"
} ],
"http_status" : 200,
“page” : 1,
“per-page” : 100,
“total-pages” : 1
“total-entries” : 1,
“result_length” : 1
}
|
XML
|
http://api.unroole.com/accounts/1/channels.xml?token=1f0qpLwoV5oIcfnU2yvO&search=Website
|
<hash>
<channels type="array">
<channel>
<id type="integer">7</id>
<name>promotions</name>
<type>Website</type>
<url>http://promotions-testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/channels/logos/7/original/qrcode.234073.png</logo-url>
</channel>
</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>
<http-status type="integer">200</http-status>
</hash>
|