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:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the document or file whose version is going to be deleted |
versionNumber | Integer | true | Content version to be deleted |
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the document or file whose version is going to be returned |
versionNumber | Integer | true | Content version to be returned |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be returned. If not specified then all fields will be included. |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the content object for which binary content is to be returned |
versionNumber | Integer | true | Content version whose binary content is 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 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:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the document or file whose versions are going to be returned |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
startIndex | Integer | false | Zero-relative index of the first matching content to be returned |
count | Integer | false | Maximum number of contents to be returned |
fields | String | false | Fields to be returned on each content. If not specified then relevant fields will be included. |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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:
Name | Type | Required | Description |
---|---|---|---|
contentID | String | true | ID of the document or file that is going to be updated based on a given version. |
versionNumber | Integer | true | Content version to use to update the content. |
Query Parameters:
Name | Type | Required | Description |
---|---|---|---|
fields | String | false | Fields to be returned. If not specified then all fields will be included. |
Retrieves:
Return Status:
HTTP Status Code | Description |
---|---|
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 |