Difference between revisions of "API Collections List"
Tommy.leung (Talk | contribs) |
Tommy.leung (Talk | contribs) (→Examples) |
||
Line 366: | Line 366: | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
</hash> | </hash> | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | === Search for 'test' returning all fields === | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Parameters | ||
+ | ! Values | ||
+ | |- | ||
+ | | token | ||
+ | | 1f0qpLwoV5oIcfnU2yvO | ||
+ | |- | ||
+ | | search | ||
+ | | test | ||
+ | |- | ||
+ | | fields | ||
+ | | id,name,description,file_name,content_type,file_size,updated_at,created_at,type,video_id,dimensions,upload_id,private,sharable,editable,printable,used,tags,url,styles | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/channels/1/collections.json?token=1f0qpLwoV5oIcfnU2yvO&search=test&fields=id,name,description,activate_at,deactivate_at,active,disable_deactivation,slideshow,rotation_speed,updated_at,created_at,items</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | { "collection" : [ { "active" : true, | ||
+ | "created_at" : "2012-06-26T13:13:15Z", | ||
+ | "deactivate_at" : "2017-06-26", | ||
+ | "description" : "this is the sample description", | ||
+ | "id" : 1, | ||
+ | "items" : [ { "editable" : true, | ||
+ | "id" : 2, | ||
+ | "item_id" : 302, | ||
+ | "printable" : true, | ||
+ | "shareable" : false, | ||
+ | "type" : "Pdf" | ||
+ | }, | ||
+ | { "editable" : false, | ||
+ | "id" : 5, | ||
+ | "item_id" : 299, | ||
+ | "printable" : false, | ||
+ | "shareable" : false, | ||
+ | "type" : "Document" | ||
+ | }, | ||
+ | { "editable" : false, | ||
+ | "id" : 7, | ||
+ | "item_id" : 107, | ||
+ | "printable" : false, | ||
+ | "shareable" : false, | ||
+ | "type" : "Video" | ||
+ | }, | ||
+ | { "editable" : false, | ||
+ | "id" : 3, | ||
+ | "item_id" : 301, | ||
+ | "printable" : false, | ||
+ | "shareable" : true, | ||
+ | "type" : "Document" | ||
+ | }, | ||
+ | { "editable" : false, | ||
+ | "id" : 4, | ||
+ | "item_id" : 300, | ||
+ | "printable" : true, | ||
+ | "shareable" : false, | ||
+ | "type" : "Pdf" | ||
+ | }, | ||
+ | { "editable" : true, | ||
+ | "id" : 1, | ||
+ | "item_id" : 303, | ||
+ | "printable" : true, | ||
+ | "shareable" : true, | ||
+ | "type" : "Image" | ||
+ | }, | ||
+ | { "editable" : false, | ||
+ | "id" : 6, | ||
+ | "item_id" : 108, | ||
+ | "printable" : false, | ||
+ | "shareable" : false, | ||
+ | "type" : "Video" | ||
+ | } | ||
+ | ], | ||
+ | "name" : "test collection", | ||
+ | "rotation_speed" : 4, | ||
+ | "slideshow" : true, | ||
+ | "updated_at" : "2012-06-26T13:13:15Z" | ||
+ | } ], | ||
+ | "http_status" : 200, | ||
+ | "result_length" : 1 | ||
+ | } | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! XML | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/channels/1/collections.xml?token=1f0qpLwoV5oIcfnU2yvO&search=test&fields=id,name,description,activate_at,deactivate_at,active,disable_deactivation,slideshow,rotation_speed,updated_at,created_at,items</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <hash> | ||
+ | <collection type="array"> | ||
+ | <collection> | ||
+ | <id type="integer">1</id> | ||
+ | <name>test collection</name> | ||
+ | <description>this is the sample description</description> | ||
+ | <updated-at type="datetime">2012-06-26T13:13:15Z</updated-at> | ||
+ | <created-at type="datetime">2012-06-26T13:13:15Z</created-at> | ||
+ | <deactivate-at type="date">2017-06-26</deactivate-at> | ||
+ | <active type="boolean">true</active> | ||
+ | <slideshow type="boolean">true</slideshow> | ||
+ | <rotation-speed type="integer">4</rotation-speed> | ||
+ | <items type="array"> | ||
+ | <item> | ||
+ | <id type="integer">2</id> | ||
+ | <item-id type="integer">302</item-id> | ||
+ | <type>Pdf</type> | ||
+ | <shareable type="boolean">false</shareable> | ||
+ | <editable type="boolean">true</editable> | ||
+ | <printable type="boolean">true</printable> | ||
+ | </item> | ||
+ | <item> | ||
+ | <id type="integer">5</id> | ||
+ | <item-id type="integer">299</item-id> | ||
+ | <type>Document</type> | ||
+ | <shareable type="boolean">false</shareable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | </item> | ||
+ | <item> | ||
+ | <id type="integer">7</id> | ||
+ | <item-id type="integer">107</item-id> | ||
+ | <type>Video</type> | ||
+ | <shareable type="boolean">false</shareable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | </item> | ||
+ | <item> | ||
+ | <id type="integer">3</id> | ||
+ | <item-id type="integer">301</item-id> | ||
+ | <type>Document</type> | ||
+ | <shareable type="boolean">true</shareable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | </item> | ||
+ | <item> | ||
+ | <id type="integer">4</id> | ||
+ | <item-id type="integer">300</item-id> | ||
+ | <type>Pdf</type> | ||
+ | <shareable type="boolean">false</shareable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">true</printable> | ||
+ | </item> | ||
+ | <item> | ||
+ | <id type="integer">1</id> | ||
+ | <item-id type="integer">303</item-id> | ||
+ | <type>Image</type> | ||
+ | <shareable type="boolean">true</shareable> | ||
+ | <editable type="boolean">true</editable> | ||
+ | <printable type="boolean">true</printable> | ||
+ | </item> | ||
+ | <item> | ||
+ | <id type="integer">6</id> | ||
+ | <item-id type="integer">108</item-id> | ||
+ | <type>Video</type> | ||
+ | <shareable type="boolean">false</shareable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | </item> | ||
+ | </items> | ||
+ | </collection> | ||
+ | </collection> | ||
+ | <result-length type="integer">1</result-length> | ||
+ | <http-status type="integer">200</http-status> | ||
+ | </hash> | ||
</nowiki> | </nowiki> | ||
</blockquote> | </blockquote> | ||
|} | |} |
Revision as of 10:25, 26 June 2012
Contents
Summary
Allows querying for a list of collections in the channel. The query is a wildcard search on:
- name
- description
URI
https://api.unroole.com/channels/[channel-id]/collections
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 collections to return. | ||
fields | id, name, items | API Collection Fields | List of comma separated fields to be returned in the response. |
Response
Field | Type | Description |
---|---|---|
http_status | integer | API Status Code http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html |
error | Rails default | |
collections | array of API Collection Fields | List of collections |
result_length | integer | Total number of results that could be returned. This may not be the number of collections in the response, as it is truncated by limit parameter. |
Examples
All collections on the channel
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
JSON |
---|
http://api.unroole.com/channels/1/collections.json?token=1f0qpLwoV5oIcfnU2yvO |
|
XML |
---|
http://api.unroole.com/channels/1/collections.xml?token=1f0qpLwoV5oIcfnU2yvO |
|
Search for 'test' returning all fields
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
search | test |
fields | id,name,description,file_name,content_type,file_size,updated_at,created_at,type,video_id,dimensions,upload_id,private,sharable,editable,printable,used,tags,url,styles |
JSON |
---|
http://api.unroole.com/channels/1/collections.json?token=1f0qpLwoV5oIcfnU2yvO&search=test&fields=id,name,description,activate_at,deactivate_at,active,disable_deactivation,slideshow,rotation_speed,updated_at,created_at,items |
|
XML |
---|
http://api.unroole.com/channels/1/collections.xml?token=1f0qpLwoV5oIcfnU2yvO&search=test&fields=id,name,description,activate_at,deactivate_at,active,disable_deactivation,slideshow,rotation_speed,updated_at,created_at,items |
|