Difference between revisions of "API Mobile Briefcase Users List"
Tommy.leung (Talk | contribs) (→URI) |
|||
(8 intermediate revisions by 3 users not shown) | |||
Line 39: | Line 39: | ||
|- | |- | ||
| limit | | limit | ||
− | | | + | | 500 |
| | | | ||
| | | | ||
| The maximum number of mobile briefcase users to return. | | The maximum number of mobile briefcase users to return. | ||
+ | |- | ||
+ | | page | ||
+ | | 1 | ||
+ | | Depends on query | ||
+ | | Integer | ||
+ | | The current pages to display based on the limit. | ||
|} | |} | ||
Line 61: | Line 67: | ||
! Field | ! Field | ||
! Type | ! Type | ||
+ | |- | ||
+ | | id | ||
+ | | integer | ||
|- | |- | ||
| username | | username | ||
Line 68: | Line 77: | ||
| string | | string | ||
|} | |} | ||
+ | |- | ||
+ | | 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. |
+ | |} | ||
+ | |||
+ | == Examples == | ||
+ | |||
+ | === All mobile briefcase users on an account === | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Parameters | ||
+ | ! Values | ||
+ | |- | ||
+ | | token | ||
+ | | 1f0qpLwoV5oIcfnU2yvO | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | { "users" : [ { "domain" : "Testing domain", | ||
+ | "id" : 1, | ||
+ | "username" : "sampleuser@test.com" | ||
+ | }, | ||
+ | { "domain" : "Testing domain", | ||
+ | "id" : 2, | ||
+ | "username" : "another_user@test.com" | ||
+ | }, | ||
+ | { "domain" : "North Pole - Santa's House", | ||
+ | "id" : 3, | ||
+ | "username" : "elf1@santa.com" | ||
+ | }, | ||
+ | { "domain" : "North Pole - Santa's House", | ||
+ | "id" : 4, | ||
+ | "username" : "elf2@santa.com" | ||
+ | }, | ||
+ | { "domain" : "North Pole - Santa's House", | ||
+ | "id" : 5, | ||
+ | "username" : "rudolph@santa-reindeers.com" | ||
+ | } | ||
+ | ], | ||
+ | “page” : 1, | ||
+ | “per-page” : 500, | ||
+ | “total-pages” : 1, | ||
+ | “total-entries” : 5, | ||
+ | “result_length” : 5, | ||
+ | "http_status" : 200 | ||
+ | } | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! XML | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <hash> | ||
+ | <users type="array"> | ||
+ | <user> | ||
+ | <id type="integer">1</id> | ||
+ | <username>sampleuser@test.com</username> | ||
+ | <domain>Testing domain</domain> | ||
+ | </user> | ||
+ | <user> | ||
+ | <id type="integer">2</id> | ||
+ | <username>another_user@test.com</username> | ||
+ | <domain>Testing domain</domain> | ||
+ | </user> | ||
+ | <user> | ||
+ | <id type="integer">3</id> | ||
+ | <username>elf1@santa.com</username> | ||
+ | <domain>North Pole - Santa's House</domain> | ||
+ | </user> | ||
+ | <user> | ||
+ | <id type="integer">4</id> | ||
+ | <username>elf2@santa.com</username> | ||
+ | <domain>North Pole - Santa's House</domain> | ||
+ | </user> | ||
+ | <user> | ||
+ | <id type="integer">5</id> | ||
+ | <username>rudolph@santa-reindeers.com</username> | ||
+ | <domain>North Pole - Santa's House</domain> | ||
+ | </user> | ||
+ | </users> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">500</per-page”> | ||
+ | <total-pages type="integer">1</total-pages> | ||
+ | <total-entries type="integer">5</total-entries> | ||
+ | <result-length type="integer">5</result-length> | ||
+ | <http-status type="integer">200</http-status> | ||
+ | </hash> | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | === Search for domain 'santa' === | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Parameters | ||
+ | ! Values | ||
+ | |- | ||
+ | | token | ||
+ | | 1f0qpLwoV5oIcfnU2yvO | ||
+ | |- | ||
+ | | search | ||
+ | | santa | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/1/mobile_briefcase_users.json?token=1f0qpLwoV5oIcfnU2yvO&search=santa</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | { | ||
+ | "users" : [ { "domain" : "North Pole - Santa's House", | ||
+ | "id" : 3, | ||
+ | "username" : "elf1@santa.com" | ||
+ | }, | ||
+ | { "domain" : "North Pole - Santa's House", | ||
+ | "id" : 4, | ||
+ | "username" : "elf2@santa.com" | ||
+ | }, | ||
+ | { "domain" : "North Pole - Santa's House", | ||
+ | "id" : 5, | ||
+ | "username" : "rudolph@santa-reindeers.com" | ||
+ | } | ||
+ | ], | ||
+ | “page” : 1, | ||
+ | “per-page” : 500, | ||
+ | “total-pages” : 1, | ||
+ | “total-entries” : 3, | ||
+ | “result_length” : 3, | ||
+ | "http_status" : 200 | ||
+ | } | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! XML | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO&search=santa</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <hash> | ||
+ | <users type="array"> | ||
+ | <user> | ||
+ | <id type="integer">3</id> | ||
+ | <username>elf1@santa.com</username> | ||
+ | <domain>North Pole - Santa's House</domain> | ||
+ | </user> | ||
+ | <user> | ||
+ | <id type="integer">4</id> | ||
+ | <username>elf2@santa.com</username> | ||
+ | <domain>North Pole - Santa's House</domain> | ||
+ | </user> | ||
+ | <user> | ||
+ | <id type="integer">5</id> | ||
+ | <username>rudolph@santa-reindeers.com</username> | ||
+ | <domain>North Pole - Santa's House</domain> | ||
+ | </user> | ||
+ | </users> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">500</per-page”> | ||
+ | <total-pages type="integer">1</total-pages> | ||
+ | <total-entries type="integer">3</total-entries> | ||
+ | <result-length type="integer">3</result-length> | ||
+ | <http-status type="integer">200</http-status> | ||
+ | </hash> | ||
+ | |||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | === Search for the first elf === | ||
+ | ''result_length is 2 because there are 2 mobile briefcase users that can be returned, but the user requested only for 1'' | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Parameters | ||
+ | ! Values | ||
+ | |- | ||
+ | | token | ||
+ | | 1f0qpLwoV5oIcfnU2yvO | ||
+ | |- | ||
+ | | search | ||
+ | | elf | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/1/mobile_briefcase_users.json?token=1f0qpLwoV5oIcfnU2yvO&search=elf&limit=1</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | { "users" : [ { "domain" : "North Pole - Santa's House", | ||
+ | "id" : 3, | ||
+ | "username" : "elf1@santa.com" | ||
+ | } ], | ||
+ | “page” : 1, | ||
+ | “per-page” : 500, | ||
+ | “total-pages” : 1, | ||
+ | “total-entries” : 2, | ||
+ | “result_length” : 2, | ||
+ | "http_status" : 200 | ||
+ | } | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! XML | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO&search=elf&limit=1</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <hash> | ||
+ | <users type="array"> | ||
+ | <user> | ||
+ | <id type="integer">3</id> | ||
+ | <username>elf1@santa.com</username> | ||
+ | <domain>North Pole - Santa's House</domain> | ||
+ | </user> | ||
+ | </users> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">500</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> | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
|} | |} |
Latest revision as of 10:08, 29 November 2013
Contents
Summary
Allows querying for a list of assets. The query is a wildcard search on the asset's:
- username
- domain
URI
https://api.unroole.com/accounts/[account-id]/mobile_briefcase_users
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 | 500 | The maximum number of mobile briefcase users to return. | ||
page | 1 | Depends on query | Integer | The current pages to display based on the limit. |
Response
Field | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
http_status | integer | API Status Code http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html | ||||||||
error | Rails default | |||||||||
users | array of users | Each user:
| ||||||||
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 mobile briefcase users on an account
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
JSON |
---|
http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO |
|
XML |
---|
http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO |
|
Search for domain 'santa'
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
search | santa |
JSON |
---|
http://api.unroole.com/accounts/1/mobile_briefcase_users.json?token=1f0qpLwoV5oIcfnU2yvO&search=santa |
|
XML |
---|
http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO&search=santa |
|
Search for the first elf
result_length is 2 because there are 2 mobile briefcase users that can be returned, but the user requested only for 1
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
search | elf |
JSON |
---|
http://api.unroole.com/accounts/1/mobile_briefcase_users.json?token=1f0qpLwoV5oIcfnU2yvO&search=elf&limit=1 |
|
XML |
---|
http://api.unroole.com/accounts/1/mobile_briefcase_users.xml?token=1f0qpLwoV5oIcfnU2yvO&search=elf&limit=1 |
|