Add a Task Attachment
/ic/api/process/v1/tasks/{id}/attachments
Adds an attachment to a task.
NOTE:
Whether a process application uses documents or attachments depends on the application configuration.
- If Oracle Content and Experience(documents) is enabled, the application can only use documents, and API operations on attachments do not apply.
 - If Oracle Content and Experience(documents) is not enabled, the application can only use attachments, and API operations on documents do not apply.
 
To identify whether Oracle Content and Experience(documents) is enabled in a process application, use the API /ic/api/process/v1/processes/{processId} to retrieve process instance details. Oracle Content and Experience(documents) is enabled when the parameter isDoCSEnabled=true.
Request
- multipart/mixed
 
Response
- application/json
 
200 Response
object400 Response
401 Response
404 Response
409 Response
500 Response
Examples
The following example shows how to add an attachment by submitting a POST request on the REST resource.
Send Request
curl -F  "part1=@request.json;type=application/json" -F "part2=@serviceRequest.txt;type=text/plain" -X POST http://example.com/ic/api/process/v1/tasks/20002/attachments  -H "Content-Type:multipart/mixed" -H 'Authorization: Bearer access_token'Where,
- 
                        
example.comis the host where Oracle Integration is running. - 
                        
request.jsonis the file containing data about the attachment.The following is an example of
request.jsonfile:{ "attachmentName" : "serviceRequest.txt", "mimeType" :"text/plain" }Where
attachmentNameis the name of the attachment file andmimeTypeis its mime-type. 
Example of Response Body
{
   "levels":0,
   "links":[
      {
         "href":"http://example.com/ic/api/process/v1/tasks/200002",
         "length":0,
         "rel":"parent"
      },
      {
         "href":"http://example.com/ic/api/process/v1/tasks/200002/attachments",
         "length":0,
         "rel":"self"
      },
      {
         "href":"http://example.com/ic/api/process/v1/tasks/200002/attachments",
         "length":0,
         "rel":"canonical"
      }
   ],
   "attachment":[
      {
         "levels":0,
         "title":"serviceRequest.txt",
         "mimeType":"text/plain",
         "attachmentScope":"TASK",
         "updatedBy":"jsmith",
         "userId":"jsmith",
         "updatedDate":"2016-08-25T08:53:07.000Z",
         "uri"{ "href":"http://example.com/ic/api/process/v1/tasks/200002/attachments/serviceRequest.txt/stream",
            "length":0,
            "rel":"stream"
         }
      }
   ]
}