Update a file 

Update a file in your file collection programmatically.

See Authenticating requests for information about how to authenticate the request.

Table 1. Atom API request details

Method Resource address Input representation Description
PUT Determine the resource address in either of the following ways:

  • Value of the href attribute of the <link rel="edit-media"> element in the file's Document Atom entries.

  • Construct the address using the following URL:/basic/api/myuserlibrary/document/{document-id}/mediawhere {document-id} is the <td:uuid> or <td:label> element of the document entry.

binary media Updates a file in your collection.

You can use one or more of these headers.

Table 2. Input headers

Parameter Required Description
Content-Type No Used to specify the mime type for the content being sent to the server. If the collection does not support the specified content type, the server returns HTTP response code 415 (Unsupported media type). When a media resource is posted, the mime-type of the resource is set to this value if it is provided. Otherwise, the mime-type of the extension of the Slug header is used. A Content-Type that is an empty string, whitespace only, or equal to "unknown/unknown" is considered to be not-specified.
Content-Language No Specifies the language of the content being sent to the server. All contents are handled using UTF-8 encoding on the server.
Content-Length No Specifies the content length when sending media content.

You can use one or more of these input parameters with the request. Separate multiple parameters with an ampersand (&).

Table 3. Input parameters

Parameter Description
commentNotification String. Specifies whether you want to get an email notification when someone adds or updates a comment on a file. Options are on or off.
created Date to use as the creation date of the file. Specify the time in the number of milliseconds since January 1, 1970, 00:00:00 GMT time. This value can be set by the user, and defaults to the current system time on the server.
identifier Indicates how the document is identified in the {document-id} variable segment of the web address. By default, look up is performed with the expectation that the URL contains the value from the <td:uuid> element of a File Atom entry. Specify "label" if the URL instead contains the value from the <td:label> element of a File Atom entry.
includePath Specifies whether to include the file path information. This parameter takes a Boolean value of either true or false. If true , adds an entry extension <td:path> showing the path to the object.
mediaNotification String. Specifies whether the person updating the file wants to get an email notification when someone subsequently updates the file. Options are on or off.
modified Date to use as the last modified date of the file. Specify the time in the number of milliseconds since January 1, 1970, 00:00:00 GMT time. This value can be set by the user, and defaults to the current system time on the server.
recommendation Specifies whether the person updating the document recommends the document. This parameter takes a Boolean value of either on or off. The default is off.
removeTag Removes the specified tag. Use it multiple times to remove multiple tags or set it equal to null to remove all tags.
sendNotification Specified whether notifications should be sent about this update. This parameter takes a Boolean value of either true or false.
sharePermission Defines the level of permission that the people listed in the sharedWith parameter should have to the file. Only applicable if the sharedWith parameter is passed. Permission level options are Edit or View.
shareSummary Text. Explanation of the share.
shareWith User ID of the user to share the content with. This parameter can be applied multiple times. Supports multivalue.
tag String. Keyword that helps to classify the file. This parameter can be applied multiple times if multiple tags are passed. Supports multivalue. If this parameter and the removeTag parameter pass the same value, the removeTag parameter gets precedence.
visibility String. Specifies who can see the file. Options are private or public. A public file is visible to all users and can be shared by all users. Defaults to private.


Input

A file consists of both the information about the file, which is also known as metadata, and the binary data that the file contains. Pass binary data as the input of the request. To update the metadata associated with the file, pass new values for the document elements using input parameters.


Output

An Atom document representing the updated file.

Returned HTTP headers

HTTP/1.1 200 OK

Error codes


Parent topic

Work with files

Related reference
File content


   

 

});

+

Search Tips   |   Advanced Search