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:
NameTypeRequiredDescription
contentIDStringtrueID of the content object to be updated with new attachments.
Query Parameters:
NameTypeRequiredDescription
minorBooleanfalseFlag indicating whether this update is a minor edit (true) or not (false)
fieldsStringfalseFields to be returned
Takes:
  • Multipart of subtype form-data that will include a section for each file being uploaded.
  • Retrieves:
  • Attachment[]
  • Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    messageIDStringtrueID of the message to be updated with new attachments.
    Query Parameters:
    NameTypeRequiredDescription
    minorBooleanfalseFlag indicating whether this update is a minor edit (true) or not (false)
    fieldsStringfalseFields to be returned
    Takes:
  • Multipart of subtype form-data that will include a section for each file being uploaded.
  • Retrieves:
  • Attachment[]
  • Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    attachmentIDStringtrueID of the attachment to be deleted
    Query Parameters:
    NameTypeRequiredDescription
    minorBooleanfalseFlag indicating whether this update is a minor edit (true) or not (false)
    Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    attachmentIDStringtrueID of the attachment to be returned
    Query Parameters:
    NameTypeRequiredDescription
    fieldsStringfalseFields to be returned
    Retrieves:
  • Attachment containing the specified attachment
  • Return Status:
    HTTP Status CodeDescription
    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}/data

    Return the specified attachment as binary content.

    Path Parameters:
    NameTypeRequiredDescription
    attachmentIDStringtrueID of the attachment to be returned
    Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    contentIDStringtrueID of the content object to return its attachments.
    Query Parameters:
    NameTypeRequiredDescription
    fieldsStringfalseFields to be returned
    Retrieves:
  • Attachment[] containing the specified attachments
  • Return Status:
    HTTP Status CodeDescription
    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}/data

    Return the binary content of the specified file.

    Path Parameters:
    NameTypeRequiredDescription
    fileIDStringtrueID of the file to return its binary content
    Return Status:
    HTTP Status CodeDescription
    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:
    NameTypeRequiredDescription
    messageIDStringtrueID of the nessage to return its attachments.
    Query Parameters:
    NameTypeRequiredDescription
    fieldsStringfalseFields to be returned
    Retrieves:
  • Attachment[] containing the requested attachments
  • Return Status:
    HTTP Status CodeDescription
    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