Difference between revisions of "API Assets List"
Tommy.leung (Talk | contribs) (→Examples) |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 45: | Line 45: | ||
|- | |- | ||
| limit | | limit | ||
− | | | + | | 500 |
| | | | ||
| | | | ||
Line 55: | Line 55: | ||
| [[API Asset Fields]] | | [[API Asset Fields]] | ||
| List of comma separated fields to be returned in the response. | | 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 | | url_time_limit | ||
Line 75: | Line 81: | ||
| array of [[API Asset Fields]] | | array of [[API Asset Fields]] | ||
| List of files that matched the search query | | 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 | | 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. |
|} | |} | ||
Line 179: | 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 287: | 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 364: | 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 429: | 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> | ||
</hash> | </hash> | ||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | === Search by mime type === | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! 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 | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable collapsible collapsed" | ||
+ | |- | ||
+ | ! JSON | ||
+ | |- | ||
+ | | <nowiki>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</nowiki> | ||
+ | |- | ||
+ | | <blockquote> | ||
+ | <nowiki> | ||
+ | { "assets" : [ { "content_type" : "audio/x-wav", | ||
+ | "created_at" : "2012-06-25T14:59:35Z", | ||
+ | "description" : "", | ||
+ | "dimensions" : { }, | ||
+ | "editable" : false, | ||
+ | "file_name" : "crowd_outside_1.wav", | ||
+ | "file_size" : 1779054, | ||
+ | "id" : 301, | ||
+ | "name" : "crowd_outside_1", | ||
+ | "printable" : false, | ||
+ | "private" : true, | ||
+ | "sharable" : false, | ||
+ | "styles" : { }, | ||
+ | "tags" : [ ], | ||
+ | "type" : "Document", | ||
+ | "upload_id" : "asset_upload_d04ea4e4", | ||
+ | "url" : "https://cdn-unroole-dev.s3.amazonaws.com/system/asset_documents/301/original/crowd_outside_1.wav?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=0ixBoW33U1byJf%2F8AwiXrZ%2BaKYc%3D&Expires=1340639827&updated_at=1340636375", | ||
+ | "video_id" : null | ||
+ | } ], | ||
+ | "http_status" : 200, | ||
+ | “page” : 1, | ||
+ | “per-page” : 500, | ||
+ | “total-pages” : 1, | ||
+ | “total-entries” : 1, | ||
+ | “result_length” : 1 | ||
+ | } | ||
+ | </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">301</id> | ||
+ | <name>crowd_outside_1</name> | ||
+ | <description></description> | ||
+ | <file-name>crowd_outside_1.wav</file-name> | ||
+ | <content-type>audio/x-wav</content-type> | ||
+ | <file-size type="integer">1779054</file-size> | ||
+ | <created-at type="datetime">2012-06-25T14:59:35Z</created-at> | ||
+ | <type>Document</type> | ||
+ | <video-id nil="true"> | ||
+ | </video-id> | ||
+ | <dimensions></dimensions> | ||
+ | <upload-id>asset_upload_d04ea4e4</upload-id> | ||
+ | <private type="boolean">true</private> | ||
+ | <sharable type="boolean">false</sharable> | ||
+ | <editable type="boolean">false</editable> | ||
+ | <printable type="boolean">false</printable> | ||
+ | <tags type="array"/> | ||
+ | <url>https://cdn-unroole-dev.s3.amazonaws.com/system/asset_documents/301/original/crowd_outside_1.wav?AWSAccessKeyId=AKIAI54VTHLBTQ46H3FA&Signature=Bhm0T2E950u69lQVcJ3eP9wIDVI%3D&Expires=1340639684&updated_at=1340636375</url> | ||
+ | <styles></styles> | ||
+ | </asset> | ||
+ | </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> | ||
+ | <http-status type="integer">200</http-status> | ||
+ | </hash> | ||
+ | |||
+ | </nowiki> | ||
+ | </blockquote> | ||
+ | |} | ||
+ | |||
+ | === 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'' | ||
+ | |||
+ | {| 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, | ||
+ | “page” : 1, | ||
+ | “per-page” : 3, | ||
+ | “total-pages” : 3, | ||
+ | “total-entries” : 7, | ||
+ | “result_length” : 3 | ||
+ | } | ||
+ | </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> | ||
+ | <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> | ||
+ | </hash> | ||
</nowiki> | </nowiki> | ||
</blockquote> | </blockquote> | ||
|} | |} |
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 |
|