Delete finished documents

This service provides a way for the user to delete documents, that are either CANCELLED or SUBMITTED, and are older than the provided date, returning the count of documents deleted afterwards. It requires two values, a date String and a password unique to the service.

By default, the password is configured to be "admin" but this value is not recommended for production purposes and should be altered to an appropriate value.

Service description

Table 1. Document Delete service
Service Description

deleteFinished

Deletes submitted/cancelled documents older than the provided date.

Parameter

Type

Description

deleteArtifactBean

ArtifactDeleteBean

An wrapper object that contains both a date and password needed for the service function.

Returns

Type

Description

removeDocumentsResult

RemoveDocumentsResult

A response object containing the number of documents deleted.

The following table describes the bean that contains the needed info for the service to function:

Table 2. ArtifactDeleteBean
Variable Type Description

deleteBefore

Date

A date that determines from what date older documents should be deleted

password

String

A password to safeguard the service

Usage

Example of a call the requests finished documents older than 2021-01-01:

curl -X DELETE "https:///eSignServer/rest/v1/document/deleteFinished" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"deleteBefore\": \"2021-01-01\", \"password\": \"admin\"}"

Request

{
    "deleteBefore": "2021-01-01",
    "password": "admin"
}

Response

{
  "Data": 1459,
  "Errors": null,
  "Warnings": null
}

Configuration

The configurations described in the following table allow for the customization of the purge service.

Table 3. Configuration
Name Default Value Description

artifact.purge.service.password

admin

The service’s password. By default the value is "admin". This value needs to be encoded with eSign’s obfuscate service.

artifact.purge.deleteSignatures

false

A flag that determines if the signatures associated with the documents should also be deleted.

artifact.purge.service.bulk

2000

The number of documents that are deleted on each database access. This is done to reduce the impact on the system’s performance and prevent unexpected issues like memory issues (Millions of documents being loaded at once to be worked on).

Example of Purge service configuration usage
{
    "properties":{

        ...

        "artifact.purge.service.password": "$\{enc:<obfuscated password>\}",
        "artifact.purge.deleteSignatures": false,
        "artifact.purge.service.bulk": 2000

        ...
    }
}