Attachments
List attachments for a case
URL
GET /case/{case_id}/attachments
Example request
$ curl \
-H 'Authorization: Bearer {bearer_token}' \
-H 'Accept: application/xml'
http://api.staging.decisiv.net/platform_api/cases/{case_id}/attachments
Response
<?xml version="1.0" encoding="UTF-8"?>
<a:attachments xmlns:r="http://www.decisiv.net/platform_api/0.0.7/Case/RecipientResponse"
xmlns:s="http://www.decisiv.net/platform_api/0.0.7/Case/SenderResponse"
xmlns:a="http://www.decisiv.net/platform_api/0.0.7/Case/AttachmentResponse"
xmlns:ct="http://www.decisiv.net/platform_api/0.0.7/Case/CaseTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.decisiv.net/platform_api/0.0.7/Case/AttachmentResponse">
<a:attachment>
<a:URL>url</a:URL>
<a:subjectURL>subjectURL</a:subjectURL>
<a:downloadURL>downloadURL</a:downloadURL>
<a:description>description0</a:description>
<a:filename>filename0</a:filename>
<a:format>format</a:format>
<a:size>0</a:size>
<a:internal>false</a:internal>
<a:createdAt>2006-05-04T18:13:51.0</a:createdAt>
<a:updatedAt>2006-05-04T18:13:51.0</a:updatedAt>
<a:public>false</a:public>
<s:sender>
<s:id>id0</s:id>
<s:name>name0</s:name>
<s:groupName>groupName0</s:groupName>
<s:URL>URL0</s:URL>
</s:sender>
</a:attachment>
<a:attachment>
<a:URL>url</a:URL>
<a:subjectURL>subjectURL</a:subjectURL>
<a:downloadURL>downloadURL</a:downloadURL>
<a:description>description0</a:description>
<a:filename>filename0</a:filename>
<a:format>format</a:format>
<a:size>0</a:size>
<a:internal>true</a:internal>
<a:createdAt>2006-05-04T18:13:51.0</a:createdAt>
<a:updatedAt>2006-05-04T18:13:51.0</a:updatedAt>
<a:public>false</a:public>
<s:sender>
<s:id>id1</s:id>
<s:name>name1</s:name>
<s:groupName>groupName1</s:groupName>
<s:URL>URL1</s:URL>
</s:sender>
</a:attachment>
</a:attachments>
Get a single attachment for a case
URL
GET /case/{case_id}/attachment/{id}
Example request
$ curl \
-H 'Authorization: Bearer {bearer_token}' \
-H 'Accept: application/xml'
http://api.staging.decisiv.net/platform_api/cases/{case_id}/attachments/{id}
Response
<?xml version="1.0" encoding="UTF-8"?>
<a:attachment xmlns:r="http://www.decisiv.net/platform_api/0.0.7/Case/RecipientResponse"
xmlns:s="http://www.decisiv.net/platform_api/0.0.7/Case/SenderResponse"
xmlns:a="http://www.decisiv.net/platform_api/0.0.7/Case/AttachmentResponse"
xmlns:ct="http://www.decisiv.net/platform_api/0.0.7/Case/CaseTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.decisiv.net/platform_api/0.0.7/Case/AttachmentResponse">
<a:URL>url</a:URL>
<a:subjectURL>subjectURL</a:subjectURL>
<a:downloadURL>downloadURL</a:downloadURL>
<a:description>description0</a:description>
<a:filename>filename0</a:filename>
<a:size>0</a:size>
<a:internal>false</a:internal>
<a:createdAt>2006-05-04T18:13:51.0</a:createdAt>
<a:updatedAt>2006-05-04T18:13:51.0</a:updatedAt>
<a:public>false</a:public>
<s:sender>
<s:id>id0</s:id>
<s:name>name0</s:name>
<s:groupName>groupName0</s:groupName>
<s:URL>URL0</s:URL>
</s:sender>
</a:attachment>
Add an attachment to a case
URL
POST /case/{case_id}/attachments
Example request
Assumes you have file in the same directory named attached_file.pdf
and another file in the same directory named attachments_xml.xml
which
contains the XML body.
$ curl -v \
-XPOST \
-H 'Authorization: Bearer {bearer token}' \
-F "file=@attached_file.pdf;filename=some_other_name.pdf" \
-F "body= `cat attachments_xml.xml`" \
http://api.staging.decisiv.net/platform_api/cases/{case_id}/attachments
Request
Headers
Content-Type: multipart/form-data
Required Parameters
Name |
Value |
body:description |
Text description of the attachment. |
file |
See below. |
Optional Parameters
Name |
Value |
body:sender |
User that is creating the attachment. If omitted a default user will be used. |
body:internal |
Controls visibility of attachment, setting as internal indicates it will only be visible to the senders group. If omitted, the attachment will be visible to both parties |
Body
Content-Disposition: form-data; name="body"
<?xml version="1.0" encoding="UTF-8"?>
<a:attachment xmlns:r="http://www.decisiv.net/platform_api/0.0.7/Case/RecipientRequest"
xmlns:s="http://www.decisiv.net/platform_api/0.0.7/Case/SenderRequest"
xmlns:a="http://www.decisiv.net/platform_api/0.0.7/Case/AttachmentRequest"
xmlns:ct="http://www.decisiv.net/platform_api/0.0.7/Case/CaseTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.decisiv.net/platform_api/0.0.7/Case/AttachmentRequest">
<a:description>description0</a:description>
<a:internal>true</a:internal>
<s:sender>
<s:id>id0</s:id>
</s:sender>
</a:attachment>
File
- Content-Disposition: form-data; name=“file”; filename=“{filename}”
- Content-Transfer-Encoding: base64 is probably preferred.
- The body of the request is the appropriately encoded file contents.