FileUpload

Use this resource to add file attachments to process activities or work items.

Method summary

HTTP Method Path Description
POST /scr/api/FileUpload Adds file attachments to process activities or work items.

POST /scr/api/FileUpload

Description
Use this method to add file attachments to process activities or work items.
Resource information
Requirements Description
Response format JSON
Requires authentication Yes. The user must have author access to the process that the file is attached to.
Supports OAuth 2 client credentials Yes using a User Service ID containing Artifact Authoring Category
Rate limited Not yet
Parameters
The entries for locationField, ancestorIdField, parentIdField, and fileData must be passed in standard multipart and multiform data format.
Name Location Description Required Type
X-IBM-API-Version Header The version of the API to use. The value must be 20160630. No String
X-On-Behalf-Of Header The user context. The value must be a username in the account. The user must have permission to perform the action in the account and in the specified parent space, if any. Required if Service ID OAuth credentials are used. Not required when using User Service ID OAuth credential. String
fileData Query The file data. Yes RFC 1867 compliant multipart/form-data stream
locationField Query Depending on the object that the file is attached to, possible values are activity, app, decision, instance, policy, or post. Yes String
ancestorIdField Query The meaning depends on locationField value:
  • The process blueprint ID for an activity
  • The process application ID for an app
  • The decision diagram ID for a decision
  • The work ID of an existing instance for an instance
  • For all other locationField values, this parameter does not need to be provided
Yes String
parentIdField Query The meaning depends on locationField value:
  • The process ID for an activity
  • The application ID for an app
  • The decision ID for a decision
  • The work ID of an existing instance for an instance
  • The policy ID for a policy
  • This value does not have to be provided for post
Yes String
Response
Example output
{  
   "size":"3.0",
   "parentId":"",
   "uploadUserId":"7f0002",
   "fileItemId":"123b",
   "name":"testFileUpload",
   "ancestorId":"",
   "uploadDate":"1441217698308",
   "status":"SUCCESS",
   "isPublic":"false",
   "location":"instance",
   "uploadUserName":"admin",
   "version":"20160630",
   "type":"1",
   "id":"5f501e134978a"
}
Response properties
uploadUserId
The ID of the user who uploaded the file.
location
The location that the file was uploaded to.
status
The string value that indicates the result of the upload attempt. The possible values include:
SUCCESS
The operation was successful.
FAILED
The upload failed.
FAILED_DELETED
The upload failed. Verify the file does not contain a virus, and try again.
SIZE
The upload failed because the file was larger than 50 MB.
SPACE
The upload failed because the account did not have enough space available.
type
The type of file or document with the associated numeric value.
Type value Description
1 Generic document. Used if the file doesn't fall under one of the other values.
2 Microsoft Excel file
3 Image
4 PDF document
5 Microsoft PowerPoint document
6 Microsoft Project document
7 Microsoft Visio document
8 Microsoft Word document
9 Text file
version
The version of the API that was used to create the response.
size
The size of the uploaded file in bytes.
id
The ID of the uploaded profile. Use this ID with the FileDownload service to download the file.
parentId
The ID of the parent item that the uploaded file is attached to.
name
The name of the uploaded file.
ancestorId
The ID of the ancestor that the uploaded file belongs to.
uploadDate
The date the file was uploaded. The value is expressed in milliseconds since epoch, which is 1 January 1970 at midnight Coordinated Universal Time (UTC).
uploadUserName
The name of the user who uploaded the file.
Response messages
HTTP code Reason
200

The request was completed successfully.

401

The user isn't authorized to make the request.

405 The specified method is not allowed. Select POST method.