Adding a file using a multipart POST
Added by IBM contributorIBM | Edited by IBM contributorPaul Bastide on September 3, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Add a file to your library using a multipart POST.
Provide a multipart post in which each parameter has a Content-Disposition: form-data, and the name is the parameter name.

If done properly, you will make an HTML page with JSON in the body.

Input
Method URI Description
POST /files/{auth}/api/myuserlibrary/feed Adds the binary data and creates a file Atom document containing the metadata of a file to your library.
POST /files/{auth}/api/myuserlibrary/feed Adds the binary data and creates a file Atom document containing the metadata of a file to your library using the HTTP Basic Authorization endpoint
Name Type Optional Description
auth
enumerated No The authorization protocol being used by your application to access Connections Cloud.
Authorized values:
  • basic
  • oauth
Name Type Optional Description
commentNotification
enumerated Yes 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.
Authorized values:
  • on
  • off
description
string Yes Summary of the document in plain text.
file
string Yes Contains the binary media of the file.
label
string Yes Label of the file to be created.
mediaNotification
enumerated Yes 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.
Authorized values:
  • on
  • off
X-Update-Nonce
string 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. If both are specified, the value in this parameter takes precedence over the value of X-Update-Nonce in the header.
sharePermission
enumerated Yes 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.
Authorized values:
  • Edit
  • View
shareSummary
string Yes Text. Explanation of the share.
shareWith
string Yes User ID of the user to share the content with. This parameter can be applied multiple times. Supports multivalue.
tag
string Yes String. Keyword that helps to classify the file. This parameter can be applied multiple times if multiple tags are passed. Supports multivalue.
visibility
enumerated Yes 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.
Authorized values:
  • private
  • public
Name Type Optional Description
Content-Type
string Yes 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
string Yes Specifies the language of the content being sent to the server. All contents are handled using UTF-8 encoding on the server.
Content-Length
string Yes Specifies the content length when sending media content.
X-Update-Nonce
string Yes String. Represents a unique data string generated by the server upon request that you must provide to secure the request. See Getting a cryptographic key for information about how to request the data string.
Content-Disposition
5.0
string Yes sets the file to be used explicitly with a microblog, and hides it from public files view
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:
  • basic
  • bearer
Output
Content Type: application/json
Code Description
200
Indicates that the file entry was successfully created. If an error occurs, this header contains one of the error codes.
401
Unauthorized.
403
Forbidden.
404
Not Found.
409
Conflict.
415
Unsupported media type