Creating a large file field for activity nodesSince 10/2014
Added by wiki wiki | Edited by Xiaofeng Zhang on May 9, 2016
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To create a file field that contains a large file for existing activity nodes, use the 2-Phase upload API. This API has been enabled since Connections SC Oct 2014 release.

To create a file field that contains a large file for an existing activities node, such as an entry or to-do item, post the file content by the 2-Phase upload API. The API only supports single file uploads. If you want to upload more than one file, you will have to go through the upload process for each file.


The 2-Phase upload API is used for large file uploading. The API is based on existing API entry URLs, but it involves some special headers and request parameters. The generated response codes are the same codes that are found in previous APIs.

 

 

Phase 1

Initialize an upload session

 

Input

Input format depends on the file content type that will be sent. The request should not put the file content in the request body.

Note: application/atom+xml and multipart are not supported.

 

Output

A response that contains the header that is used in Phase 2.

 

Phase 2

Upload the file content.

 

Input

Input format is file-in-body. The request body is the file content.

 

Output

None.

Input
Method URI Description
POST /activities/service/atom2/activity The URI for the 2-Phase request.
Name Type Optional Description
activityUuid
string No The UUID of the activity node in which you create a file field. Can be found in the <id> element of the activity node entry.
Name Type Optional Description
X-IBM-UPLOAD-METHOD
string No This is required when performing both requests. It identifies the request you are making as a 2-Phase request.
X-IBM-UPLOAD-SIZE
string No Indicates the size of the file. This is required in the Phase 1 request.
X-IBM-UPLOAD-TOKEN
string No The value is the token got in Phase 1. This is required in the Phase 2 request.
FieldTitle
string Yes Specify the field name of the file, this is optional in the Phase 2 request.
Output
Name Type Optional Description
X-IBM-UPLOAD-TOKEN
string No This token is returned from Phase 1 request. It is needed in the Phase 2 request.
Code Description
200
Return from Phase 1 request to indicate the request was received successfully.
201
Return from Phase 2 request to indicate the file was created successfully.
400
Bad Request.
403
Forbidden. The server refuses to fulfill a request, typically because the request was for an object that you don't have permission to access or the file uploaded contains virus or not permitted content.
404
Not Found.
413
Indicate the request body too large or the file size exceeded the limit.
415
Indicate the file type is not supported.