User Tools

Site Tools


put_collection_resource

PUT /collections/:collectionkey/resources/:resourcekey.format

We also support POST for this operation, due to better support for POST in some client libraries.

PUT /collections/:collectionkey/resources/:resourcekey.format assigns resource :resourcekey to collection :collectionkey provided that you own the resource, and that you either own the collection or the collection allows public submissions (privacy=1). If the resource previously belonged to a different collection it is removed from the previous collection. You may also optionally specify tags for the resource as form-encoded data in the PUT or POST content body. If the resource already belongs to the collection, the tags will be updated (replacing any previous tags).

  • response formats supported: .xml, .json
  • query parameters: none
  • request content body format (optional): form-encoded (type application/x-www-form-urlencoded) key/value pair; e.g. tags=tag1,tag2. This is the format used by a web browser to POST an html form.
  • Curl command line:
    curl -u user:apikey -X PUT -d tags=tag1,tag2 https://4thefile.com/api_v1/collections/ESuVkqZF/resources/Wgo3oLtl.xml
  • example xml response:
<?xml version="1.0" encoding="UTF-8"?>
<data>
  <message>Added resource Wgo3oLtl to collection ESuVkqZF. Set tags for Wgo3oLtl to: tag1,tag2</message>
  <resource_link>https://4thefile.com/api_v1/collections/ESuVkqZF/resources/Wgo3oLtl.xml</resource_link>
</data>
put_collection_resource.txt · Last modified: 2010/11/05 16:17 by jay