2.4 Rescan multiple files

Body (payload)

Request

Value

Method

POST

URL

https://api.metadefender.com/v2/file/rescan

Throttled

Yes

Summary

Invoke rescan of an array of files.

By default will be set on the low priority queue.

Use Cases (used by)

MetaDefender Cloud rescan already scanned files

Request

Header Parameters

 

Description

Allowed Values

Required

apikey

Give rights to use the endpoint (API Authentication Mechanisms)

<your apikey>

YES

Body (payload)

 

Format

Required

Example

HTTP Body

json

YES

{
"file_ids": ["54fa9de940134850a72ecbf65c2dfe72", "54fa9de940134850a72ecbf65c2dfe72", "e9a50107c3414aeca6d791de6fc742c2", "18856de8d0b94c05ae74fde67ce106f5"]
}

Response

HTTP Status Codes

Please refer to Status Codes for more information.

Body

Example of successful scan request:

{
"success": true,
"data": [
{
"data_id": "bzE3MDQxMEIxVk8yZVlUZXJrZU51Mmx0Nng",
"status": "inqueue",
"in_queue": 1,
"file_id": "54fa9de940134850a72ecbf65c2dfe72"
},
{
"data_id": "bzE3MDQxMEhrVWQyZUZwZ0JKZUl1aGxLVHg",
"status": "inqueue",
"in_queue": 1,
"file_id": "e9a50107c3414aeca6d791de6fc742c2"
},
{
"file_id": "18856de8d0b94c05ae74fde67ce106f51",
"code": 404007,
"err": "Requested file id does not exist in our records",
"status": 404
}
]
}

Descriptions of response:

dataId

the identifier used to retrieve scan results

Errors

Please refer to Errors for more information.

Sample code (Node.js)

var http = require("https");
var options = {
"method": "POST",
"hostname": "api.metadefender.com",
"path": "/v2/file/rescan",
"headers": {
"apikey": process.env.APIKEY,
"content-type": "application/json"
}
};
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.write(JSON.stringify({ "file_ids": ["54fa9de940134850a72ecbf65c2dfe72", "54fa9de940134850a72ecbf65c2dfe72", "e9a50107c3414aeca6d791de6fc742c2", "18856de8d0b94c05ae74fde67ce106f5"] }));
req.end();

Sample code (cURL)

curl -X POST \
https://api.metadefender.com/v2/file/rescan \
-H 'apikey: ${APIKEY}' \
-H 'content-type: application/json' \
-d '{"file_ids": ["54fa9de940134850a72ecbf65c2dfe72", "54fa9de940134850a72ecbf65c2dfe72", "e9a50107c3414aeca6d791de6fc742c2", "18856de8d0b94c05ae74fde67ce106f5"]}