API Accounts List

From unroole CMS wiki
Revision as of 10:01, 29 November 2013 by Mbasset (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Summary

Allows querying for a list of accounts belonging to the user. The query is a wildcard search on:

  • name

URI

https://api.unroole.com/accounts

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 accounts to return.
page 1 Depends on query Integer The current pages to display based on the limit.
fields id, name, url, logo_url API Account Fields List of comma separated fields to be returned in the response.
url_time_limit 60 The length of time (in seconds) that the logo 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 Account Fields List of accounts
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 accounts accessible by the user

Parameters Values
token 1f0qpLwoV5oIcfnU2yvO

Limit 1 account and set the fields returned

result_length is 4 because there are 4 accounts that can be returned, but the user requested only for 1

Parameters Values
token 1f0qpLwoV5oIcfnU2yvO
limit 1
fields id,url,updated_at

Search for "test account"

remember to encode the query string parameters

Parameters Values
token 1f0qpLwoV5oIcfnU2yvO
search test%20account