Difference between revisions of "API Assets List"
Line 201: | Line 201: | ||
], | ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 500, | ||
+ | “total-pages” : 1 | ||
+ | “total-entries” : 15, | ||
+ | “result_length” : 15 | ||
} | } | ||
</nowiki> | </nowiki> | ||
Line 309: | Line 313: | ||
</asset> | </asset> | ||
</assets> | </assets> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">500</per-page”> | ||
+ | <total-pages type="integer">1</total-pages> | ||
+ | <total-entries type="integer">15</total-entries> | ||
<result-length type="integer">15</result-length> | <result-length type="integer">15</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
Line 386: | Line 394: | ||
], | ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 500, | ||
+ | “total-pages” : 1, | ||
+ | “total-entries” : 2, | ||
+ | “result_length” : 2 | ||
} | } | ||
</nowiki> | </nowiki> | ||
Line 451: | Line 463: | ||
</asset> | </asset> | ||
</assets> | </assets> | ||
+ | <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> | <result-length type="integer">2</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
Line 503: | Line 519: | ||
} ], | } ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 500, | ||
+ | “total-pages” : 1, | ||
+ | “total-entries” : 1, | ||
+ | “result_length” : 1 | ||
} | } | ||
</nowiki> | </nowiki> | ||
Line 542: | Line 562: | ||
</asset> | </asset> | ||
</assets> | </assets> | ||
+ | <page type="integer">1</page> | ||
+ | <per-page” type="integer">500</per-page”> | ||
+ | <total-pages type="integer">1</total-pages> | ||
+ | <total-entries type="integer">1</total-entries> | ||
<result-length type="integer">1</result-length> | <result-length type="integer">1</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
Line 676: | Line 700: | ||
], | ], | ||
"http_status" : 200, | "http_status" : 200, | ||
− | + | “page” : 1, | |
+ | “per-page” : 3, | ||
+ | “total-pages” : 3, | ||
+ | “total-entries” : 7, | ||
+ | “result_length” : 3 | ||
} | } | ||
</nowiki> | </nowiki> | ||
Line 813: | Line 841: | ||
</asset> | </asset> | ||
</assets> | </assets> | ||
− | <result-length type="integer"> | + | <page type="integer">1</page> |
+ | <per-page” type="integer">3</per-page”> | ||
+ | <total-pages type="integer">3</total-pages> | ||
+ | <total-entries type="integer">7</total-entries> | ||
+ | <result-length type="integer">3</result-length> | ||
<http-status type="integer">200</http-status> | <http-status type="integer">200</http-status> | ||
</hash> | </hash> |
Latest revision as of 10:04, 29 November 2013
Contents
Summary
Allows querying for a list of assets. The query is a wildcard search on the asset's:
- id
- name
- description
- content_type
- type
- file_name
- upload_id
- tags
URI
https://api.unroole.com/accounts/[account-id]/assets
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 assets to return. | ||
fields | id, name, file_name, url | API Asset Fields | List of comma separated fields to be returned in the response. | |
page | 1 | Depends on query | Integer | The current pages to display based on the limit. |
url_time_limit | 60 | The length of time (in seconds) that the asset url will be accessible for if the asset is private. 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 | |
assets | array of API Asset Fields | List of files that matched the search query |
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 assets on an account
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
JSON |
---|
http://api.unroole.com/accounts/1/assets.json?token=1f0qpLwoV5oIcfnU2yvO |
|
XML |
---|
http://api.unroole.com/accounts.xml?token=1f0qpLwoV5oIcfnU2yvO |
|
All pdfs on an account
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
search | |
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/accounts/1/assets.json?token=1f0qpLwoV5oIcfnU2yvO&search=pdf&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 |
|
XML |
---|
http://api.unroole.com/accounts/1/assets.xml?token=1f0qpLwoV5oIcfnU2yvO&search=pdf&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 |
|
Search by mime type
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
search | audio |
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/accounts/1/assets.json?token=1f0qpLwoV5oIcfnU2yvO&search=audio&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 |
|
XML |
---|
http://api.unroole.com/accounts/1/assets.xml?token=1f0qpLwoV5oIcfnU2yvO&search=audio&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 |
|
Search by tag and name returning first 3 matches
result_length is 7 because there are 7 assets that can be returned, but the user requested only for 3
Parameters | Values |
---|---|
token | 1f0qpLwoV5oIcfnU2yvO |
search | space |
limit | 3 |
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/accounts/1/assets.json?token=1f0qpLwoV5oIcfnU2yvO&search=space&limit=3&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 |
|
XML |
---|
http://api.unroole.com/accounts/1/assets.xml?token=1f0qpLwoV5oIcfnU2yvO&search=audio&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 |
|