Summary
Allows querying for a list of accounts belonging to the user. The query is a wildcard search on:
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
|
TBD
|
|
|
The maximum number of accounts to return.
|
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
Examples
All accounts accessible by the user
Parameters
|
Values
|
token
|
1f0qpLwoV5oIcfnU2yvO
|
JSON
|
http://api.unroole.com/accounts.json?token=1f0qpLwoV5oIcfnU2yvO
|
{
"accounts" : [
{"id" : 1,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/1/original/heic0206c.jpg",
"name" : "testaccount",
"url" : "http://testaccount.unroole.com"
},
{ "id" : 2,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/2/original/heic1007a.jpg0",
"name" : "sample",
"url" : "http://sample.unroole.com"
},
{ "id" : 3,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/3/original/heic0904a.jpg",
"name" : "immersion",
"url" : "http://immersion.unroole.com"
},
{ "id" : 4,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/4/original/Sun_Rise.jpg",
"name" : "testaccount2",
"url" : "http://testaccount2.unroole.com"
}
],
"http_status" : 200,
"result_length" : 4
}
|
XML
|
http://api.unroole.com/accounts.xml?token=1f0qpLwoV5oIcfnU2yvO
|
<hash>
<accounts type="array">
<account>
<id type="integer">1</id>
<name>testaccount</name>
<url>http://testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/1/original/heic0206c.jpg</logo-url>
</account>
<account>
<id type="integer">2</id>
<name>sample</name>
<url>http://sample.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/2/original/heic1007a.jpg</logo-url>
</account>
<account>
<id type="integer">3</id>
<name>immersion</name>
<url>http://immersion.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/3/original/heic0904a.jpg</logo-url>
</account>
<account>
<id type="integer">4</id>
<name>testaccount2</name>
<url>http://testaccount2.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/4/original/Sun_Rise.jpg</logo-url>
</account>
</accounts>
<result-length type="integer">4</result-length>
<http-status type="integer">200</http-status>
</hash>
|
Limit 1 account and set the fields returned
result_limit is 4 because there is 4 accounts that can be returned, but the user requested only for 1
Parameters
|
Values
|
token
|
1f0qpLwoV5oIcfnU2yvO
|
limit
|
1
|
fields
|
id,url,updated_at
|
JSON
|
http://api.unroole.com:3000/accounts.json?token=1f0qpLwoV5oIcfnU2yvO&limit=1&fields=id,url,updated_at
|
{
"accounts" : [
{ "id" : 1,
"updated_at" : "2012-06-14T17:46:10Z",
"url" : "http://testaccount.unroole.com"
} ],
"http_status" : 200,
"result_length" : 4
}
|
XML
|
http://api.unroole.com:3000/accounts.xml?token=1f0qpLwoV5oIcfnU2yvO&limit=1&fields=id,url,updated_at
|
<hash>
<accounts type="array">
<account>
<id type="integer">1</id>
<url>http://testaccount.unroole.com</url>
<updated-at type="datetime">2012-06-14T17:46:10Z</updated-at>
</account>
</accounts>
<result-length type="integer">4</result-length>
<http-status type="integer">200</http-status>
</hash>
|
Search for "test account"
remember to encode the query string parameters
Parameters
|
Values
|
token
|
1f0qpLwoV5oIcfnU2yvO
|
search
|
test%20account
|
JSON
|
http://api.unroole.com:3000/accounts.json?token=1f0qpLwoV5oIcfnU2yvO&search=test%20account
|
{ "accounts" : [
{ "id" : 1,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/1/original/heic0206c.jpg",
"name" : "testaccount",
"url" : "http://testaccount.unroole.com"
},
{ "id" : 4,
"logo_url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/4/original/Sun_Rise.jpg",
"name" : "testaccount2",
"url" : "http://testaccount2.unroole.com"
}
],
"http_status" : 200,
"result_length" : 2
}
|
XML
|
http://api.unroole.com:3000/accounts.xml?token=1f0qpLwoV5oIcfnU2yvO&search=test%20account
|
<hash>
<accounts type="array">
<account>
<id type="integer">1</id>
<name>testaccount</name>
<url>http://testaccount.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/1/original/heic0206c.jpg</logo-url>
</account>
<account>
<id type="integer">4</id>
<name>testaccount2</name>
<url>http://testaccount2.unroole.com</url>
<logo-url>https://cdn-unroole-dev.s3.amazonaws.com/system/accounts/logos/4/original/Sun_Rise.jpg</logo-url>
</account>
</accounts>
<result-length type="integer">2</result-length>
<http-status type="integer">200</http-status>
</hash>
|