User Tools

Site Tools


get_collection_resources

GET /collections/:collectionkey/resources.format

GET /collections/:collectionkey/resources.format returns the list of resources in collection :collectionkey

  • response formats supported: .xml, .json
  • query parameters:
    • per_page (optional - max resources to return at once, default 30)
    • page (optional, default 1)
    • tag (optional – only Resources with matching tag will be included. tag=untagged matches only Resources in Collection which have no tags)
    • cdate (optional - only resources added after cdate will be returned. cdate must be in yyyy-mm-dd or “yyyy-mm-dd hh:mm:ss” format)
  • Curl command line:
    curl -u user:apikey "https://4thefile.com/api_v1/collections/ESuVkqZF/resources.xml?page=1&per_page=10&tag=newtag"
  • example xml response:
<?xml version="1.0" encoding="UTF-8"?>
<data>
  <next_page_link></next_page_link>
  <resource_count>2</resource_count>
  <resources>
    <resourcekey>zdV2nhbL</resourcekey>
    <collection_api_link>https://4thefile.com/api_v1/collections/ESuVkqZF.xml</collection_api_link>
    <collection_date>2010-06-02 14:18:20</collection_date>
    <collection_name>4theFile demo</collection_name>
    <collectionkey>ESuVkqZF</collectionkey>
    <counter>39</counter>
    <created>2010-06-02 14:18:20</created>
    <from_email>joe blow &lt;jblow@purplewire.com&gt;</from_email>
    <message_from>joe blow &lt;▆▆▆▆▆purplewire.com&gt;</message_from>
    <modified>2010-11-04 17:11:18</modified>
    <own>1</own>
    <resource_https_url>https://4theFile.com/zdV2nhbL</resource_https_url>
    <resource_url>http://4theFile.com/zdV2nhbL</resource_url>
    <retention>0</retention>
    <size>877</size>
    <subject>submissions are closed for this collection!</subject>
    <tags>newtag</tags>
  </resources>
  <resources>
    <resourcekey>UVlY0i71</resourcekey>
    <collection_api_link>https://4thefile.com/api_v1/collections/ESuVkqZF.xml</collection_api_link>
    <collection_date>2010-06-02 14:07:11</collection_date>
    <collection_name>4theFile demo</collection_name>
    <collectionkey>ESuVkqZF</collectionkey>
    <counter>2</counter>
    <created>2010-06-02 14:07:11</created>
    <from_email>joe blow &lt;jblow@4theFile.com&gt;</from_email>
    <message_from>joe blow &lt;jblow@4theFile.com&gt;</message_from>
    <modified>2010-11-05 10:17:35</modified>
    <own>1</own>
    <resource_https_url>https://4theFile.com/UVlY0i71</resource_https_url>
    <resource_url>http://4theFile.com/UVlY0i71</resource_url>
    <retention>0</retention>
    <size>205</size>
    <subject>Example 4theFile resource</subject>
    <tags>newtag,tag33</tags>
  </resources>
</data>
  • field descriptions:
    • resource_count: the the total number of resources that would be returned by the query if not limited by the per_page parameter (which defaults to 30, not to “unlimited”)
    • counter: how many times the resource has been access through either the web interface or API
    • from_email: the address in the From: header of the submitted resource
    • message_from: the From address shown in the public view of the resource (may be redacted)
    • owned: 1=resource is owned by you. see http://4thefile.com/pages/collections/FAQ.html#owns
    • retention: 1=permanent. Resources are normally removed from the system if not accessed for a period of 6 months. Resources with retention=1 will never be removed unless removed by the resource owner.
    • size: total size of the resource in bytes.
    • tags: tags are used to categorize resources within a collection. A resource can have multiple tags (comma-separated).
get_collection_resources.txt · Last modified: 2010/12/02 22:34 by jay