Difference between revisions of "API Assets List"
Tommy.leung (Talk | contribs) (→Examples) |
Tommy.leung (Talk | contribs) (→Examples) |
||
Line 524: | Line 524: | ||
</hash> | </hash> | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | === Search by tag and name returning first 3 matches === | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! 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 | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>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</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | { "assets" : [ { "content_type" : "image/jpeg", | ||
+ | "created_at" : "2012-06-19T14:32:31Z", | ||
+ | "description" : null, | ||
+ | "dimensions" : { "icon" : { "height" : "32", | ||
+ | "width" : "32" | ||
+ | }, | ||
+ | "original" : { "height" : "90", | ||
+ | "width" : "120" | ||
+ | }, | ||
+ | "thumb" : { "height" : "150", | ||
+ | "width" : "150" | ||
+ | } | ||
+ | }, | ||
+ | "editable" : false, | ||
+ | "file_name" : "another-earth-in-outer-space.jpg", | ||
+ | "file_size" : 4502, | ||
+ | "id" : 108, | ||
+ | "name" : "Another Earth in Outer Space?", | ||
+ | "printable" : false, | ||
+ | "private" : null, | ||
+ | "sharable" : false, | ||
+ | "styles" : { "icon" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/108/icon/another-earth-in-outer-space.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=Nz9OrotCBejmkw%2BpWrYTwhrFIW4%3D&Expires=1340640174&updated_at=1340116351", | ||
+ | "original" : "http://www.youtube.com/v/j1GOm1mxHA8&feature=youtube_gdata_player", | ||
+ | "thumb" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/108/thumb/another-earth-in-outer-space.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=eVwMwrGSiTQxWbYlkIGCT%2FUGhU4%3D&Expires=1340640174&updated_at=1340116351" | ||
+ | }, | ||
+ | "tags" : [ ], | ||
+ | "type" : "Video", | ||
+ | "upload_id" : "asset_upload_71b69654", | ||
+ | "url" : "http://www.youtube.com/v/j1GOm1mxHA8&feature=youtube_gdata_player", | ||
+ | "video_id" : "j1GOm1mxHA8" | ||
+ | }, | ||
+ | { "content_type" : "image/jpeg", | ||
+ | "created_at" : "2012-06-19T14:32:30Z", | ||
+ | "description" : null, | ||
+ | "dimensions" : { "icon" : { "height" : "32", | ||
+ | "width" : "32" | ||
+ | }, | ||
+ | "original" : { "height" : "90", | ||
+ | "width" : "120" | ||
+ | }, | ||
+ | "thumb" : { "height" : "150", | ||
+ | "width" : "150" | ||
+ | } | ||
+ | }, | ||
+ | "editable" : false, | ||
+ | "file_name" : "seeing-earth-in-space-new-iss-timelapse-footage.jpg", | ||
+ | "file_size" : 4826, | ||
+ | "id" : 107, | ||
+ | "name" : "Seeing Earth IN Space [new ISS timelapse footage]", | ||
+ | "printable" : false, | ||
+ | "private" : null, | ||
+ | "sharable" : false, | ||
+ | "styles" : { "icon" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/107/icon/seeing-earth-in-space-new-iss-timelapse-footage.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=ZHia0dMJUqQO0Opl3XcqtQDiXBw%3D&Expires=1340640175&updated_at=1340116350", | ||
+ | "original" : "http://www.youtube.com/v/BEhIGoq9tow&feature=youtube_gdata_player", | ||
+ | "thumb" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/107/thumb/seeing-earth-in-space-new-iss-timelapse-footage.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=G69GzxJElMEeZLrg8CfMGzmmxd4%3D&Expires=1340640174&updated_at=1340116350" | ||
+ | }, | ||
+ | "tags" : [ ], | ||
+ | "type" : "Video", | ||
+ | "upload_id" : "asset_upload_71b69654", | ||
+ | "url" : "http://www.youtube.com/v/BEhIGoq9tow&feature=youtube_gdata_player", | ||
+ | "video_id" : "BEhIGoq9tow" | ||
+ | }, | ||
+ | { "content_type" : "image/jpeg", | ||
+ | "created_at" : "2012-06-14T18:01:54Z", | ||
+ | "description" : "", | ||
+ | "dimensions" : { "icon" : { "height" : "32", | ||
+ | "width" : "32" | ||
+ | }, | ||
+ | "original" : { "height" : "1329", | ||
+ | "width" : "1280" | ||
+ | }, | ||
+ | "thumb" : { "height" : "150", | ||
+ | "width" : "150" | ||
+ | } | ||
+ | }, | ||
+ | "editable" : false, | ||
+ | "file_name" : "opo0301a.jpg", | ||
+ | "file_size" : 623601, | ||
+ | "id" : 5, | ||
+ | "name" : "opo0301a", | ||
+ | "printable" : false, | ||
+ | "private" : false, | ||
+ | "sharable" : false, | ||
+ | "styles" : { "icon" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/icon/opo0301a.jpg?1339696912&updated_at=1340636802", | ||
+ | "original" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/original/opo0301a.jpg?1339696912&updated_at=1340636802", | ||
+ | "thumb" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/thumb/opo0301a.jpg?1339696912&updated_at=1340636802" | ||
+ | }, | ||
+ | "tags" : [ "space", | ||
+ | "stars" | ||
+ | ], | ||
+ | "type" : "Image", | ||
+ | "upload_id" : "asset_upload_f064de41", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/original/opo0301a.jpg?1339696912&updated_at=1340636802", | ||
+ | "video_id" : null | ||
+ | } | ||
+ | ], | ||
+ | "http_status" : 200, | ||
+ | "result_length" : 7 | ||
+ | } | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! XML | ||
+ | |- | ||
+ | | <nowiki>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</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <hash> | ||
+ | <assets type="array"> | ||
+ | <asset> | ||
+ | <id type="integer">108</id> | ||
+ | <name>Another Earth in Outer Space?</name> | ||
+ | <description nil="true"> | ||
+ | </description> | ||
+ | <file-name>another-earth-in-outer-space.jpg</file-name> | ||
+ | <content-type>image/jpeg</content-type> | ||
+ | <file-size type="integer">4502</file-size> | ||
+ | <created-at type="datetime">2012-06-19T14:32:31Z</created-at> | ||
+ | <type>Video</type> | ||
+ | <video-id>j1GOm1mxHA8</video-id> | ||
+ | <dimensions> | ||
+ | <original> | ||
+ | <width>120</width> | ||
+ | <height>90</height> | ||
+ | </original> | ||
+ | <thumb> | ||
+ | <width>150</width> | ||
+ | <height>150</height> | ||
+ | </thumb> | ||
+ | <icon> | ||
+ | <width>32</width> | ||
+ | <height>32</height> | ||
+ | </icon> | ||
+ | </dimensions> | ||
+ | <upload-id>asset_upload_71b69654</upload-id> | ||
+ | <private nil="true"> | ||
+ | </private> | ||
+ | <sharable type="boolean">false</sharable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | <tags type="array"/> | ||
+ | <url>http://www.youtube.com/v/j1GOm1mxHA8&feature=youtube_gdata_player</url> | ||
+ | <styles> | ||
+ | <original>http://www.youtube.com/v/j1GOm1mxHA8&feature=youtube_gdata_player</original> | ||
+ | <thumb>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/108/thumb/another-earth-in-outer-space.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=qI5zlUYosn7MeH6OFewlinf3WzI%3D&Expires=1340640950&updated_at=1340116351</thumb> | ||
+ | <icon>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/108/icon/another-earth-in-outer-space.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=BTPpaSlwPfxgWGsLYxcNWirvXko%3D&Expires=1340640950&updated_at=1340116351</icon> | ||
+ | </styles> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">107</id> | ||
+ | <name>Seeing Earth IN Space [new ISS timelapse footage]</name> | ||
+ | <description nil="true"> | ||
+ | </description> | ||
+ | <file-name>seeing-earth-in-space-new-iss-timelapse-footage.jpg</file-name> | ||
+ | <content-type>image/jpeg</content-type> | ||
+ | <file-size type="integer">4826</file-size> | ||
+ | <created-at type="datetime">2012-06-19T14:32:30Z</created-at> | ||
+ | <type>Video</type> | ||
+ | <video-id>BEhIGoq9tow</video-id> | ||
+ | <dimensions> | ||
+ | <original> | ||
+ | <width>120</width> | ||
+ | <height>90</height> | ||
+ | </original> | ||
+ | <thumb> | ||
+ | <width>150</width> | ||
+ | <height>150</height> | ||
+ | </thumb> | ||
+ | <icon> | ||
+ | <width>32</width> | ||
+ | <height>32</height> | ||
+ | </icon> | ||
+ | </dimensions> | ||
+ | <upload-id>asset_upload_71b69654</upload-id> | ||
+ | <private nil="true"> | ||
+ | </private> | ||
+ | <sharable type="boolean">false</sharable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | <tags type="array"/> | ||
+ | <url>http://www.youtube.com/v/BEhIGoq9tow&feature=youtube_gdata_player</url> | ||
+ | <styles> | ||
+ | <original>http://www.youtube.com/v/BEhIGoq9tow&feature=youtube_gdata_player</original> | ||
+ | <thumb>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/107/thumb/seeing-earth-in-space-new-iss-timelapse-footage.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=bouXvD6JFegsBXN8nHhODmbR8bg%3D&Expires=1340640951&updated_at=1340116350</thumb> | ||
+ | <icon>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_yt_videos/107/icon/seeing-earth-in-space-new-iss-timelapse-footage.jpg?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=87edS%2BXl%2BZip8rmO4jAfLvLhK40%3D&Expires=1340640951&updated_at=1340116350</icon> | ||
+ | </styles> | ||
+ | </asset> | ||
+ | <asset> | ||
+ | <id type="integer">5</id> | ||
+ | <name>opo0301a</name> | ||
+ | <description></description> | ||
+ | <file-name>opo0301a.jpg</file-name> | ||
+ | <content-type>image/jpeg</content-type> | ||
+ | <file-size type="integer">623601</file-size> | ||
+ | <created-at type="datetime">2012-06-14T18:01:54Z</created-at> | ||
+ | <type>Image</type> | ||
+ | <video-id nil="true"> | ||
+ | </video-id> | ||
+ | <dimensions> | ||
+ | <original> | ||
+ | <width>1280</width> | ||
+ | <height>1329</height> | ||
+ | </original> | ||
+ | <thumb> | ||
+ | <width>150</width> | ||
+ | <height>150</height> | ||
+ | </thumb> | ||
+ | <icon> | ||
+ | <width>32</width> | ||
+ | <height>32</height> | ||
+ | </icon> | ||
+ | </dimensions> | ||
+ | <upload-id>asset_upload_f064de41</upload-id> | ||
+ | <private type="boolean">false</private> | ||
+ | <sharable type="boolean">false</sharable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | <tags type="array"> | ||
+ | <tag>space</tag> | ||
+ | <tag>stars</tag> | ||
+ | </tags> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/original/opo0301a.jpg?1339696912&updated_at=1340636802</url> | ||
+ | <styles> | ||
+ | <original>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/original/opo0301a.jpg?1339696912&updated_at=1340636802</original> | ||
+ | <thumb>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/thumb/opo0301a.jpg?1339696912&updated_at=1340636802</thumb> | ||
+ | <icon>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_images/5/icon/opo0301a.jpg?1339696912&updated_at=1340636802</icon> | ||
+ | </styles> | ||
+ | </asset> | ||
+ | </assets> | ||
+ | <result-length type="integer">7</result-length> | ||
+ | <http-status type="integer">200</http-status> | ||
+ | </hash> | ||
</nowiki> | </nowiki> | ||
</blockquote> | </blockquote> | ||
|} | |} |
Revision as of 12:21, 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 |
|
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
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 |
|