Add a file using a multipart POSTAdd a file to your library using a multipart POST.
See Authenticating requests for information about how to authenticate the request.
Table 1. Atom API request details
Method Resource address Input representation Description POST /form/api/myuserlibrary/feed multipart post Adds the binary data and creates a file Atom document containing the metadata of a file to your library.
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. X-Update-Nonce Yes
String. Represents a unique data string generated by the server upon request that you can provide to secure the request. See Getting a cryptographic key for information about how to request the data string.
You can include one or more of these parameters in the body of the request.
Table 3. Parameters
Parameter Description commentNotification String. Specifies whether you want to get a notification when someone adds or updates a comment on a file. Options are on or off. The default value is on. description Summary of the document in plain text. file Contains the binary media of the file. label Label of the file to be created. mediaNotification String. Specifies whether the person updating the file wants to get a notification when someone subsequently updates the file. Options are on or off. The default value is off. X-Update-Nonce String. Represents a unique data string generated by the server upon request that you can provide to secure the request. See Getting a cryptographic key for information about how to request the data string. If both are specified, the value in this parameter takes precedence over the value of X-Update-Nonce in the header. sharePermission Defines the level of permission that the people listed in the sharedWith parameter have to the file. Only applicable if the sharedWith parameter is passed. Permission level options are Edit or View. The default value is 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. 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. The default value is private.
A multipart post in which each parameter has a Content-Disposition: form-data, and the name is the parameter name.
An HTML page with JSON in the body.
Returned HTTP Headers
HTTP/1.1 200 OK
Indicates that the file entry was successfully created. If an error occurs, this header contains one of the error codes.
- HTTP/1.1 401 Unauthorized
- HTTP/1.1 403 Forbidden
- HTTP/1.1 404 Not Found
- HTTP/1.1 409 Conflict
- HTTP/1.1 415 Unsupported media type
Parent topicWork with files
Getting a cryptographic key
November 8, 2011 8:44:11 AM
Nov 8, 2011 8:44:11 AM Changed the resource address value from /basic/api/myuserlibrary/feed ... 2 Nov 8, 2011 8:42:48 AM Changed X-Update-Nonce to a required parameter and removed example bec... 1