ContentVersion

ContentVersion Service

Core API endpoint for retrieving and managing versions of documents and files.

Destroy Version

DELETE /versions/{contentID}/{versionNumber}

Delete the specified version of a specified content object.

Path Parameters:
NameTypeRequiredDescription
contentIDStringtrueID of the document or file whose version is going to be deleted
versionNumberIntegertrueContent version to be deleted
Return Status:
HTTP Status CodeDescription
204 (No Content)Request was successful
400 (Bad Request)An input value is missing or malformed
403 (Forbidden)You are not allowed to delete the specified version
404 (Not Found)The specified content object or version does not exist
409 (Conflict)Attempted to delete the last version of a document or file

Get Version

GET /versions/{contentID}/{versionNumber}

Return the specified version of a content with the specified fields.

Path Parameters:
NameTypeRequiredDescription
contentIDStringtrueID of the document or file whose version is going to be returned
versionNumberIntegertrueContent version to be returned
Query Parameters:
NameTypeRequiredDescription
fieldsStringfalseFields to be returned. If not specified then all fields will be included.
Retrieves:
  • ContentVersion containing the specified version of the content
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)An input value is missing or malformed
    403 (Forbidden)You are not allowed to access the specified content
    404 (Not Found)The specified content or version do not exist

    Get Version Data

    GET /versions/{contentID}/{versionNumber}/data

    Return the binary content of the specified version of the specified file (returns ConflictException on any other content type.)

    Path Parameters:
    NameTypeRequiredDescription
    contentIDStringtrueID of the content object for which binary content is to be returned
    versionNumberIntegertrueContent version whose binary content is to be returned
    Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    403 (Forbidden)The requesting user is not allowed to retrieve this binary data
    404 (Not Found)Specified content object does not exist
    409 (Conflict)Attempted to return binary data for a non-file content object
    Since: 3.5

    Get Versions

    GET /versions/{contentID}

    Return a paginated list of versions of the specified content.

    Path Parameters:
    NameTypeRequiredDescription
    contentIDStringtrueID of the document or file whose versions are going to be returned
    Query Parameters:
    NameTypeRequiredDescription
    startIndexIntegerfalseZero-relative index of the first matching content to be returned
    countIntegerfalseMaximum number of contents to be returned
    fieldsStringfalseFields to be returned on each content. If not specified then relevant fields will be included.
    Retrieves:
  • ContentVersion[]
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)An input value is missing or malformed
    403 (Forbidden)You are not allowed to access the specified content
    404 (Not Found)The specified content or version do not exist

    Create Version

    POST /versions/{contentID}/{versionNumber}

    Restore a content version by creating a copy of the version to restore as the newest content version and returning that content version.

    Path Parameters:
    NameTypeRequiredDescription
    contentIDStringtrueID of the document or file that is going to be updated based on a given version.
    versionNumberIntegertrueContent version to use to update the content.
    Query Parameters:
    NameTypeRequiredDescription
    fieldsStringfalseFields to be returned. If not specified then all fields will be included.
    Retrieves:
  • ContentVersion containing the new content version based on the old one.
  • Return Status:
    HTTP Status CodeDescription
    200 (OK)Request was successful
    400 (Bad Request)An input value is missing or malformed
    403 (Forbidden)You are not allowed to access the specified content
    409 (Conflict)The new content version would conflict with system restrictions (such as two documents with the same subject) if the subject of the content is not unique in the community
    404 (Not Found)The specified content or version do not exist