Difference between revisions of "API Assets List"
Tommy.leung (Talk | contribs) |
Tommy.leung (Talk | contribs) |
||
Line 79: | Line 79: | ||
| integer | | integer | ||
| Total number of results that '''could''' be returned. This may not be the number of assets in the response, as it is truncated by ''limit'' parameter. | | Total number of results that '''could''' be returned. This may not be the number of assets in the response, as it is truncated by ''limit'' parameter. | ||
+ | |} | ||
+ | |||
+ | == Examples == | ||
+ | |||
+ | === All assets on an account === | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Parameters | ||
+ | ! Values | ||
+ | |- | ||
+ | | token | ||
+ | | 1f0qpLwoV5oIcfnU2yvO | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts/1/assets.json?token=1f0qpLwoV5oIcfnU2yvO</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | { "assets" : [ { "file_name" : "に頭頂高18m.jpg", | ||
+ | "id" : 303, | ||
+ | "name" : "に頭頂高18m", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/303/original/%E3%81%AB%E9%A0%AD%E9%A0%82%E9%AB%9818%EF%BD%8D.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=ClwlDVpA2qgA9ho18aObeqPPFKc%3D&Expires=1340637051&updated_at=1340636398" | ||
+ | }, | ||
+ | { "file_name" : "GONews_SpecEd_ENG.pdf", | ||
+ | "id" : 302, | ||
+ | "name" : "GONews_SpecEd_ENG", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_pdfs/302/original/GONews_SpecEd_ENG.pdf?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=t1%2B%2BK7MKBS97C2RpHuy0n%2FM5GZk%3D&Expires=1340637051&updated_at=1340636388" | ||
+ | }, | ||
+ | { "file_name" : "crowd_outside_1.wav", | ||
+ | "id" : 301, | ||
+ | "name" : "crowd_outside_1", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_documents/301/original/crowd_outside_1.wav?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=Xk6IM4l2mdAHyzIZWOeH4AxynQA%3D&Expires=1340637051&updated_at=1340636375" | ||
+ | }, | ||
+ | { "file_name" : "bash.pdf", | ||
+ | "id" : 300, | ||
+ | "name" : "bash", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_pdfs/300/original/bash.pdf?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=qbKYr0pPpNKbm5ZF4EDP%2FMWa%2FJE%3D&Expires=1340637051&updated_at=1340636372" | ||
+ | }, | ||
+ | { "file_name" : "Ace_Auto_Parts.xls", | ||
+ | "id" : 299, | ||
+ | "name" : "Ace_Auto_Parts", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_documents/299/original/Ace_Auto_Parts.xls?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=I5mdAQIr0VGZh1QyoBXcoeGOrhw%3D&Expires=1340637051&updated_at=1340636363" | ||
+ | }, | ||
+ | { "file_name" : "another-earth-in-outer-space.jpg", | ||
+ | "id" : 108, | ||
+ | "name" : "Another Earth in Outer Space?", | ||
+ | "url" : "http://www.youtube.com/v/j1GOm1mxHA8&feature=youtube_gdata_player" | ||
+ | }, | ||
+ | { "file_name" : "seeing-earth-in-space-new-iss-timelapse-footage.jpg", | ||
+ | "id" : 107, | ||
+ | "name" : "Seeing Earth IN Space [new ISS timelapse footage]", | ||
+ | "url" : "http://www.youtube.com/v/BEhIGoq9tow&feature=youtube_gdata_player" | ||
+ | }, | ||
+ | { "file_name" : "ad_1a.jpg", | ||
+ | "id" : 104, | ||
+ | "name" : "ad_1a", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/104/original/ad_1a.jpg?1340116307&updated_at=1340116308" | ||
+ | }, | ||
+ | { "file_name" : "ad_1.jpg", | ||
+ | "id" : 103, | ||
+ | "name" : "ad_1", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/103/original/ad_1.jpg?1340116301&updated_at=1340116303" | ||
+ | }, | ||
+ | { "file_name" : "1024x748.jpg", | ||
+ | "id" : 6, | ||
+ | "name" : "1024x748", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/6/original/1024x748.jpg?1340033051&updated_at=1340636799" | ||
+ | }, | ||
+ | { "file_name" : "opo0301a.jpg", | ||
+ | "id" : 5, | ||
+ | "name" : "opo0301a", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/original/opo0301a.jpg?1339696912&updated_at=1340636802" | ||
+ | }, | ||
+ | { "file_name" : "opo0214a.jpg", | ||
+ | "id" : 4, | ||
+ | "name" : "opo0214a", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/4/original/opo0214a.jpg?1339696908&updated_at=1340636803" | ||
+ | }, | ||
+ | { "file_name" : "opo0212a.jpg", | ||
+ | "id" : 3, | ||
+ | "name" : "opo0212a", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/3/original/opo0212a.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=ROGyrA5fb7tWnKg92XVL%2FWp0bR8%3D&Expires=1340637051&updated_at=1339696904" | ||
+ | }, | ||
+ | { "file_name" : "opo0207a.jpg", | ||
+ | "id" : 2, | ||
+ | "name" : "opo0207a", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/2/original/opo0207a.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=8LsKc4CzUrRnmzXtpy16qQW%2Fsew%3D&Expires=1340637051&updated_at=1339696900" | ||
+ | }, | ||
+ | { "file_name" : "opo0201a.jpg", | ||
+ | "id" : 1, | ||
+ | "name" : "opo0201a", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/1/original/opo0201a.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=QVzWq6td%2BI8dp4UiTGHyNBomOWg%3D&Expires=1340637051&updated_at=1339696895" | ||
+ | } | ||
+ | ], | ||
+ | "http_status" : 200, | ||
+ | "result_length" : 15 | ||
+ | } | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! XML | ||
+ | |- | ||
+ | | <nowiki>http://api.unroole.com/accounts.xml?token=1f0qpLwoV5oIcfnU2yvO</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <hash> | ||
+ | <assets type="array"> | ||
+ | <asset> | ||
+ | <id type="integer">303</id> | ||
+ | <name>に頭頂高18m</name> | ||
+ | <file-name>に頭頂高18m.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/303/original/%E3%81%AB%E9%A0%AD%E9%A0%82%E9%AB%9818%EF%BD%8D.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=xtjsSeNcGkCv9rqz08xgV2ZE230%3D&Expires=1340637308&updated_at=1340636398</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">302</id> | ||
+ | <name>GONews_SpecEd_ENG</name> | ||
+ | <file-name>GONews_SpecEd_ENG.pdf</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_pdfs/302/original/GONews_SpecEd_ENG.pdf?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=KfXZSbE8bA4N4yErZX0Me2Kazgo%3D&Expires=1340637308&updated_at=1340636388</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">301</id> | ||
+ | <name>crowd_outside_1</name> | ||
+ | <file-name>crowd_outside_1.wav</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_documents/301/original/crowd_outside_1.wav?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=pwTlFVdqv%2B9zIEoTU4ULEOAgAtc%3D&Expires=1340637308&updated_at=1340636375</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">300</id> | ||
+ | <name>bash</name> | ||
+ | <file-name>bash.pdf</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_pdfs/300/original/bash.pdf?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=aiDi7sjv%2BJlU93q52bGVuPAQd60%3D&Expires=1340637308&updated_at=1340636372</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">299</id> | ||
+ | <name>Ace_Auto_Parts</name> | ||
+ | <file-name>Ace_Auto_Parts.xls</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_documents/299/original/Ace_Auto_Parts.xls?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=gqltD%2BTlw%2Bsa1dxQyt4rnVRRyjM%3D&Expires=1340637308&updated_at=1340636363</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">108</id> | ||
+ | <name>Another Earth in Outer Space?</name> | ||
+ | <file-name>another-earth-in-outer-space.jpg</file-name> | ||
+ | <url>http://www.youtube.com/v/j1GOm1mxHA8&feature=youtube_gdata_player</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">107</id> | ||
+ | <name>Seeing Earth IN Space [new ISS timelapse footage]</name> | ||
+ | <file-name>seeing-earth-in-space-new-iss-timelapse-footage.jpg</file-name> | ||
+ | <url>http://www.youtube.com/v/BEhIGoq9tow&feature=youtube_gdata_player</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">104</id> | ||
+ | <name>ad_1a</name> | ||
+ | <file-name>ad_1a.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/104/original/ad_1a.jpg?1340116307&updated_at=1340116308</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">103</id> | ||
+ | <name>ad_1</name> | ||
+ | <file-name>ad_1.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/103/original/ad_1.jpg?1340116301&updated_at=1340116303</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">6</id> | ||
+ | <name>1024x748</name> | ||
+ | <file-name>1024x748.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/6/original/1024x748.jpg?1340033051&updated_at=1340636799</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">5</id> | ||
+ | <name>opo0301a</name> | ||
+ | <file-name>opo0301a.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/original/opo0301a.jpg?1339696912&updated_at=1340636802</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">4</id> | ||
+ | <name>opo0214a</name> | ||
+ | <file-name>opo0214a.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/4/original/opo0214a.jpg?1339696908&updated_at=1340636803</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">3</id> | ||
+ | <name>opo0212a</name> | ||
+ | <file-name>opo0212a.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/3/original/opo0212a.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=j0InYb5bsws6PDB%2FUuonwRz6DdE%3D&Expires=1340637311&updated_at=1339696904</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">2</id> | ||
+ | <name>opo0207a</name> | ||
+ | <file-name>opo0207a.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/2/original/opo0207a.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=%2FaS%2FTzrmn%2BmylErDfz%2FXnlyYuAg%3D&Expires=1340637311&updated_at=1339696900</url> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">1</id> | ||
+ | <name>opo0201a</name> | ||
+ | <file-name>opo0201a.jpg</file-name> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/1/original/opo0201a.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=j24MQmhxX54Qvju9o1DflXCBqew%3D&Expires=1340637311&updated_at=1339696895</url> | ||
+ | </asset> | ||
+ | </assets> | ||
+ | <result-length type="integer">15</result-length> | ||
+ | <http-status type="integer">200</http-status> | ||
+ | </hash> | ||
+ | |||
+ | </nowiki> | ||
+ | </blockquote> | ||
|} | |} |
Revision as of 11:15, 25 June 2012
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 | TBD | 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. | |
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 |
result_length | integer | Total number of results that could be returned. This may not be the number of assets in the response, as it is truncated by limit parameter. |
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 |
|