Deleting the current version of a DMS object without user interaction

Released: JSON representation

You can delete the current version of an existing DMS object in a d.3 repository without the need for action by the user.

To delete the current version of a DMS object, you must perform the following steps:

  • Determining the URL for a repository

  • Determine the link relation for the existing DMS object

  • Determine the link relation for deleting the current version of an existing DMS object

  • Open the URL to delete the current version of the DMS object

Determining the URL for a repository

In the chapter Determining a repository, you can learn how to determine the URL for a repository.

Determine the link relation for the existing DMS object

To determine a URL for an existing DMS object, perform a search and evaluate the self link relation for an item in the result list. The chapter Retrieving and viewing the results of a search operation provides you with more information about performing a search and the description of a result list item.

Determining the link relation for deleting the current version of the existing DMS object

To determine the URL for deleting the current version of the DMS object, evaluate the delete and deleteWithReason link relations for an item in the result list. If it is essential for a reason for deletion to be specified, for example, when deleting a version that has already been released, the deleteWithReason link relation is available. Otherwise, the delete link relation contains the URL for deletion. If both link relations are missing, please check the authorizations for deleting the version of the DMS object. If the existing DMS object is being processed, the authenticated user must be the one processing the DMS object.

Open the URL to delete the current version of the DMS object

Send an HTTP DELETErequest for the delete or deleteWithReason link relations determined for the existing DMS object. If you want to a reason for deletion to be communicated, this must be entered in the body of the request. The reason for deletion must contain at least 3 characters and have a maximum of 80 characters.

Request

DELETE /dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m/A00000001
Origin: https://baseuri
Accept: application/hal+json
Content-Type: application/hal+json

{"reason":"Created accidentally."}

If the call is successful, HTTP 200 OK is returned: If the body is empty, the entire DMS object was deleted. If the DMS object contains more versions, the body contains additional link relations. If it contains the self link relation, it means there are more versions for the DMS object and you can call up more details for the DMS object using this URL. You can delete the next version of the DMS object using the delete or deleteWithReason link relations. If these link relations are not available, it means that the user is not authorized to delete the next version.

Response

HTTP/1.1 200 OK

{
        "_links": {
        "self": {
                "href": "/dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m/A00000001"
        },
                "delete": {
                "href": "/dms/r/dee1f3d3-eae8-5d9d-84d8-2d758c5ddc27/o2m/A00000001"
        }
        }
}

If deletion of the version fails, an appropriate response is displayed. For more information, see Overview of formats for errors.

The exclusive processing of a DMS object is required so users in Microsoft Office 365 can process an element. If processing via Office 365 is not complete, the request fails, and you receive the status code 403 Forbidden with the corresponding error information as the response. Please repeat the request at a later time.