Add a file to a folder or multiple folders
Add a file to a folder or multiple folders programmatically.
See Authenticating requests for information about how to authenticate the request.
Table 1. Atom API request details
Method Resource address Input representation Description POST /basic/api/myuserlibrary/document/{document-id}/feed Entry or Feed defining the folder Adds a file to the specified folder
{document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document.
Provide the following headers.
Table 2. Input headers
Header Required Description Content-Type Yes Used to specify the mime type for the content being sent to the server. Content-Language Yes Specifies the language of the content being sent to the server. All contents are handled using UTF-8 encoding on the server.
You can use the following input parameters.
Table 3. Input parameter
Parameter Description 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. Options are uuid and label . Specify label if the URL instead contains the value from the <td:label> element of a file Atom entry.
Input
Provide one of the following input types:
- Collection Atom entry document that defines the folder to which you want to add the file.
- Collections feed in which each entry identifies one of the folders to which you want to add the file.
Output
None
Returned HTTP headers
HTTP/1.1 204 No ContentIndicates that the file was successfully added to the folder or folders. If an error occurs, this header will contain one of the error codes below.
- HTTP/1.1 401 Unauthorized
- HTTP/1.1 403 Forbidden
- HTTP/1.1 404 Not Found
- HTTP/1.1 409 Conflict
Parent topic
Work with files