Add a Task Attachment

post

/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

Supported Media Types
Path Parameters
Back to Top

Response

Supported Media Types

200 Response

Attachment successfully added
Body ()
Root Schema : Collection
Type: object

400 Response

Bad request

401 Response

Unauthorized

404 Response

Task not found

409 Response

Stale task object found

500 Response

Internal Server Error
Back to Top

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.com is the host where Oracle Integration is running.

  • request.json is the file containing data about the attachment.

    The following is an example of request.json file:

    {
    "attachmentName" : "serviceRequest.txt", 
     "mimeType" :"text/plain"
    }
    

    Where attachmentName is the name of the attachment file and mimeType is 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"
         }
      }
   ]
}
Back to Top