Add a file or set of files to a folder
Add a file or files to a folder programmatically.You cannot add a file from your local directory to a folder; the file must already have been uploaded to the Files application. To add a file to a folder be an editor of the folder.
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/collection/{collection-id}/feed None required. Entry for a feed or file ids are optional. Adds a file or files that already exist in your library to the folder specified by the collection ID.
Note: {collection-id} is the value of the <td:uuid> element in the Atom document of the folder to which you would like to add the files.You can provide the following input parameter.
Table 2. Input parameter
Parameter Description itemId Note: Required if no input is provided with the request.
String. Unique ID of the file that you want to add to the folder. You can find this value in the <td:uuid> element in the file's Atom document. You can specify this parameter more than once; separate each instance with an ampersand (&).
Input
Provide one of the following input types:
- ItemID Atom entry document that defines the file that you want to add to the folder.
- Files feed in which each entry identifies one of the files that you want to add to the folder.
Output
None.Returned HTTP headers
HTTP/1.1 201 Created
Indicates that the file or files were successfully added. If an error occurs, this header contains one of the error codes.
- HTTP/1.1 400 Bad Request
- 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 filesRelated reference
File content
});