You can delete an archived document via the DELETE route /application/jobarchive/archives/:archive/documents/:revisionId. The parameter archive indicates the archive. In the parameter revisionId the document ID is stated. If the action is successful, the HTTP status code 204 is returned.
Example: Delete archived document
guzzlehttp
// User has been authenticated already
try {
$response = $client->request(
'DELETE',
'application/jobarchive/archives/invoices/documents/123'
);
if ($response->getStatusCode() !== 204) {
echo "Action could not be performed!\n";
}
} catch (Exception $e) {
echo "Error during performance: " . $e->getMessage() . "\n";
}
cURL
// User has been authenticated already
curl_setopt($curlHandle, CURLOPT_URL,
'http://example.org/jobrouter/api/rest/v2/application/jobarchive/' .
'archives/invoices/documents/123');
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($curlHandle, CURLOPT_COOKIEFILE, 'path/to/cooke/file.cookie');
$response = curl_exec($curlHandle);
$statusCode = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);
curl_close();
if ($statusCode !== 204) {
echo "Error during performance: Code - " . $statusCode . ", ";
echo "Response: " . var_export($response, true);
}