6.3 Delete Sanitized Files
Request |
Value |
Method |
DELETE |
URL |
https://api.metadefender.com/v4/file/converted/:data_id |
Status |
BETA This endpoint is subject to change or removal while in beta |
Summary
Delete the sanitized version of the file. The sanitized version of the file is automatically deleted after 24h. If the user downloads the sanitized version of the file and wants to delete the copy from our servers sooner, this endpoint can be used to request the service to delete the file immediately.
This API endpoint is only available to paid users.
Request
URL Parameters
|
Description |
:data_id |
The dat_id of the file that underwent data sanitization (original file) |
Header Parameters
|
Description |
Allowed Values |
Required |
apikey |
gives rights to use the endpoint (token authentication) (API Authentication Mechanisms) apikey must match the one used by the uploader |
apikey |
YES |
Response
HTTP Status Codes
Please refer to Status Codes for more information.
Body
Example of a successful request:
{
"bzE5MDEyMnJrc3M5YXNObTQ"
: {
"delete_sanitized"
:
true
}
}
Example of a failed request:
{
"error"
: {
"code"
:
403001
,
"messages"
: [
"Requested resource doesn't match your API key"
]
}
}
Descriptions of responses:
delete_sanitized |
Boolean flag showing the deletion status, true for successful deletion. |
Errors
Please refer to Errors for more information.
Sample code (Node.js)
var http = require(
"https"
);
var options = {
"method"
:
"DELETE"
,
"hostname"
: [
"api"
,
"metadefender"
,
"com"
],
"path"
: [
"v4"
,
"file"
,
"converted"
,
"bzE5MDEyMnJrc3M5YXNObTQ"
],
"headers"
: {
"apikey"
: process.env.APIKEY
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on(
"data"
, function (chunk) {
chunks.push(chunk);
});
res.on(
"end"
, function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
Sample code (cURL)
curl -X DELETE \
https:
//api.metadefender.com/v4/file/converted/bzE5MDEyMnJrc3M5YXNObTQ \
-H
"apikey: ${APIKEY}"