Previous Next

Add a Task Attachment

post
/tasks/{id}/attachments
Adds an attachment to a task.

The following tables summarize the client request.

Supported Media Types
  • multipart/mixed
Body Parameter
File body with Content-Type header

The following tables summarize the server response.

Supported Media Types
  • application/json
  • application/xml

200 Response

Success
Body
Example application/json

{
    "levels":0,
    "links":[
        {
            "href":"http://example.com/bpm/api/3.0/tasks/200003",
            "length":0,
            "rel":"back"
        },
        {
            "href":"http://example.com/bpm/api/3.0/tasks/200003/attachments",
            "length":0,
            "rel":"self"
        }
    ],
    "attachment":[
        {
            "updatedDate":"2015-03-10 12:29:20",
            "updatedBy":"John Steinbeck",
            "attachmentScope":"BPM",
            "uri":{
                "href":"http://example.com/bpm/api/3.0/tasks/200003/attachments/Payment+Receipt.pdf/stream",
                "length":0,
                "rel":"stream"
            },
            "userId":"jstein",
            "levels":0,
            "title":"Payment Receipt.pdf",
            "attachmentSize":69,
            "mimeType":"application/pdf"
        }
    ]
}

The following example shows a request body for adding an attachment to a task.

{
  --frontier--
  Content-Disposition: inline
  Content-Type: application/JSON
    {"attachmentName": "serviceRequestNew8.xml", "attachmentSize": "250", "mimeType": "application/xml"}
  --frontier--
  Content-Transfer-Encoding: binary

  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body xmlns:ns1="http://www.mycompany.com/ns/sr">
  <ns1:HelpDeskRequest>
  <ns1:Requester>
  <ns1:ID>wfaulk</ns1:ID>
  <ns1:FirstName>William</ns1:FirstName>
  <ns1:LastName>Faulkner</ns1:LastName>
  <ns1:Email>user1@example.com</ns1:Email>
  <ns1:Phone></ns1:Phone>
  </ns1:Requester>
  <ns1:Location>California</ns1:Location>
  <ns1:Type>Hardware</ns1:Type>
  <ns1:ProblemDescription>Unable to reboot the system</ns1:ProblemDescription>
  <ns1:Severity>2</ns1:Severity>
  <ns1:Status>Created</ns1:Status>
  <ns1:Resolution>
  <ns1:Comment>None</ns1:Comment>
  <ns1:ResolvedBy>None</ns1:ResolvedBy>
  </ns1:Resolution>
  </ns1:HelpDeskRequest>
  </soap:Body>
  </soap:Envelope>
  --frontier--
}

For information about using cURL to send requests, see Use cURL.