Updating file metadata
Added by IBM contributorIBM | Edited by IBM contributorPaul Bastide on July 13, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Update the Atom document representation of the metadata for a file from your library.

When using the application/atom+xml content type, this method replaces the content of the elements in the Atom document with the values you specify in the Atom document you provide as input. This operation updates the metadata of the file; if you want to update the file, see Updating a file.

When using any other content type, the content of the file itself is updated.

Note: {document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document. If you identify the document using the value of the <td:label>, then you must include the identifier=label parameter with the request.

Input
Method URI Description
PUT /files/{auth}/api/myuserlibrary/document/{document-id}/entry You can determine the URI in either of the following ways:
Value of the href attribute of the <link rel="edit"> element in the file's Document Atom entries.
Construct the URI using the following syntax: /{auth}/api/myuserlibrary/document/{document-id}/entry
Note: Atom elements take precedence over HTTP parameters.
Content Type: application/atom+xml
Name Type Optional Description
document-id
string No {document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document. If you identify the document using the value of the <td:label>, then you must include the identifier=label parameter with the request.
auth
enumerated No The authorization protocol being used by your application to access Connections Cloud.
Authorized values:
  • basic
  • oauth
Name Type Optional Description
propagate
boolean Yes Indicates if users that are shared with can share this document. The default value is true.
sendEmail
boolean Yes Indicates if an email notification is sent when sharing with the specified user. The default value is true.
Name Type Optional Description
X-Method-Override
string Yes Tunnels a PUT request over the HTTP POST request.
Authorization
enumerated No The authentication mechanism selected by your application to access the API.
Basic is the Base64 encoding of the IBM Connections Cloud username and password: Base64(username:password). For example, Base64(twatson@us.ibm.com:password).
Bearer is the oauth 2.0 access token that is generated when the user grants your application access to IBM Connections Cloud services.
See the reference topic "OAuth 2.0 APIs for web server flow" for more information.
Authorized values:
  • bearer
  • basic
Output
Content Type: application/atom+xml
Code Description
200
Indicates that the file entry was successfully updated. If an error occurs, this header contains one of the error codes.
401
Unauthorized.
403
Forbidden.
404
Not Found.
References
Examples
Request a Nonce, and then update the file
curl -H "Authorization: Bearer <bearer token>"  https://apps.na.collabserv.com/files/basic/api/nonce

curl -H "Authorization: Bearer <bearer token>" \ 
    -H "X-Update-Nonce":"01f9611a-51a4-4944-83bb-bb17614d1215" \ 
    'https://apps.na.collabserv.com/files/basic/api/myuserlibrary/document/75faa783-3788-476f-a911-dba65fc8a27e/entry?tag=tagger2' \ 
    -X PUT -H 'Content-Length: 232' -H 'Content-Type: application/atom+xml' \ 
    -H 'X-Update-Nonce: d2bad75e-5454-46ff-8c03-1601233b4fd5' \ 
    --data "<?xml version=\"1.0\" encoding=\"UTF-8\"?><entry xmlns=\"http://www.w3.org/2005/Atom\"><category term=\"document\" label=\"document\" scheme=\"tag:ibm.com,2006:td/type\"/><id>urn:lsid:ibm.com:td:75faa783-3788-476f-a911-dba65fc8a27e</id></entry>" 

Response returned by the server
The full atom entry with the updated tags.