Difference between revisions of "API Collections List"
m (→Optional Paramaters) |
(→Response) |
||
Line 69: | Line 69: | ||
| array of [[API Collection Fields]] | | array of [[API Collection Fields]] | ||
| List of collections | | List of collections | ||
+ | |- | ||
+ | | 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. |
|} | |} | ||
Revision as of 09:47, 29 November 2013
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 | 50 | The maximum number of collections to return. | ||
page | 1 | Depends on query | Integers | The current pages to display based on the limit. |
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 |
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 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,activate_at,deactivate_at,active,disable_deactivation,slideshow,rotation_speed,updated_at,created_at,items |
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 |
|
Limit to first 2 collections
result_length is 3 because there are 3 collections that can be returned, but the user requested only for 2
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
limit | 2 |
fields | id,name |
JSON |
---|
http://api.unroole.com/channels/1/collections.json?token=1f0qpLwoV5oIcfnU2yvO&limit=2&fields=id,name |
|
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 |
|