Attachment
Attachment Service
Service for manipulating attachments in content.
Upload New Attachment
POST /attachments/contents/{contentID}Add new attachments to the specified content. This service supports all contents, that support attachments, except for Messages. For Messages use the "attachments/messages/{messageID} service.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| contentID | String | true | ID of the content object to be updated with new attachments. |
Query Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| minor | Boolean | false | Flag indicating whether this update is a minor edit (true) or not (false) |
| fields | String | false | Fields to be returned |
Takes:
Retrieves:
Return Status:
| HTTP Status Code | Description |
|---|---|
| 201 (Created) | Request was successful |
| 400 (Bad Request) | Content does not support attachments or If any input field is malformed |
| 403 (Forbidden) | You are not allowed to perform this operation |
| 404 (Not Found) | The specified content does not exist |
Upload New Message
POST /attachments/messages/{messageID}Add new attachments to the specified message.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| messageID | String | true | ID of the message to be updated with new attachments. |
Query Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| minor | Boolean | false | Flag indicating whether this update is a minor edit (true) or not (false) |
| fields | String | false | Fields to be returned |
Takes:
Retrieves:
Return Status:
| HTTP Status Code | Description |
|---|---|
| 201 (Created) | Request was successful |
| 400 (Bad Request) | if content does not support attachments or If any input field is malformed |
| 403 (Forbidden) | If you are not allowed to perform this operation |
| 404 (Not Found) | If the specified content does not exist |
Destroy Attachment
DELETE /attachments/{attachmentID}Delete the specified attachment.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| attachmentID | String | true | ID of the attachment to be deleted |
Query Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| minor | Boolean | false | Flag indicating whether this update is a minor edit (true) or not (false) |
Return Status:
| HTTP Status Code | Description |
|---|---|
| 204 (No Content) | Request was successful |
| 400 (Bad Request) | An input field is malformed |
| 403 (Forbidden) | You are not allowed to perform this operation |
| 404 (Not Found) | The specified attachment does not exist |
Get Attachment
GET /attachments/{attachmentID}Return the specified attachment with the specified fields.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| attachmentID | String | true | ID of the attachment to be returned |
Query Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fields | String | false | Fields to be returned |
Retrieves:
Return Status:
| HTTP Status Code | Description |
|---|---|
| 200 (OK) | Request was successful |
| 400 (Bad Request) | An input field is malformed |
| 403 (Forbidden) | You are not allowed to access the specified attachment based on the content permissions |
| 404 (Not Found) | The specified attachment does not exist |
Get Attachment Data
GET /attachments/{attachmentID}/dataReturn the specified attachment as binary content.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| attachmentID | String | true | ID of the attachment to be returned |
Return Status:
| HTTP Status Code | Description |
|---|---|
| 200 (OK) | Request was successful |
| 403 (Forbidden) | The requesting user is not allowed to retrieve this attachment |
| 404 (Not Found) | The requested attachment does not exist |
Get Attachments
GET /attachments/contents/{contentID}Return the attachments with the specified fields that are associated to the specified content.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| contentID | String | true | ID of the content object to return its attachments. |
Query Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fields | String | false | Fields to be returned |
Retrieves:
Return Status:
| HTTP Status Code | Description |
|---|---|
| 200 (OK) | Request was successful |
| 400 (Bad Request) | An input field is malformed |
| 404 (Not Found) | The specified content does not exist |
Get Document Data
GET /attachments/file/{fileID}/dataReturn the binary content of the specified file.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fileID | String | true | ID of the file to return its binary content |
Return Status:
| HTTP Status Code | Description |
|---|---|
| 200 (OK) | Request was successful |
| 403 (Forbidden) | The requesting user is not allowed to retrieve this file |
| 404 (Not Found) | The requested file does not exist |
Get Message Attachments
GET /attachments/messages/{messageID}Return the attachments with the specified fields that are associated to the specified message.
Path Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| messageID | String | true | ID of the message to return its attachments. |
Query Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| fields | String | false | Fields to be returned |
Retrieves:
Return Status:
| HTTP Status Code | Description |
|---|---|
| 200 (OK) | Request was successful |
| 400 (Bad Request) | An input field is malformed |
| 403 (Forbidden) | You are not allowed to view the specified message |
| 404 (Not Found) | The specified message does not exist |