1.3 Apikey scan history
Request |
Value |
Method |
GET |
URL |
https://api.metadefender.com/v4/apikey/scan-history |
Summary
Returns a paginated list of files uploaded by the user in reverse chronological order (newest to oldest). The pagination is controlled by the user (how many items per page and which page) by specifying the limit and offset query parameters in the request.
The response only contains a summary of the files, with minimum information.
Request
Header Parameters
|
Description |
Allowed Values |
Required |
apikey |
Gives rights to use the endpoint (API Authentication Mechanisms) and also identifies the user |
apikey |
YES |
Query Parameters
|
Description |
Required |
Default |
Possible values |
?limit |
How many entries to return per request |
NO |
10,000 |
Positive integer |
?offset |
How many files to skip from the latest request |
NO |
0 |
Positive integer |
Response
The response is paginated.
HTTP Status Codes
Please refer to Status Codes for more information.
Body
Example of a successful response
{
"data"
: [
{
"data_id"
:
"bzIwMDUyNy1FS05OYmxSNm1nZDJZc0lfaF1"
,
"file_info"
: {
"display_name"
:
"master.txt"
,
"sha1"
:
"9A507866A980E96D62CA4BE4B86A89F1FCEA5593"
},
"scan_results"
: {
"scan_all_result_i"
:
0
,
"start_time"
:
"2020-05-27T08:38:52.383Z"
,
"total_avs"
:
37
,
"total_detected_avs"
:
0
}
},
{
"data_id"
:
"bzIwMDUyN2VYOFlPN1aTdWZfaUdHeGk3SW5U"
,
"file_info"
: {
"sha1"
:
"3558129EC76E384F822D539A527E81C86445B409"
,
"display_name"
:
"Capture.PNG"
},
"scan_results"
: {
"total_detected_avs"
:
0
,
"total_avs"
:
37
,
"start_time"
:
"2020-05-27T08:38:00.101Z"
,
"scan_all_result_i"
:
0
},
"sanitized"
: {
"data_id"
:
"ZzIwMDUyN2VYOFaPN1pTdWYuc2FuaXRpemVkRmM3c1NOd1hT"
,
"result"
:
"Allowed"
,
"reason"
:
""
}
},
...
]
}
Example of a failed response:
{
"error"
: {
"code"
:
404008
,
"messages"
: [
"The apikey was not found"
]
}
}
Description of response
data |
An array of files scanned, sorted by latest scan first |
data_id |
The data_id of the file |
file_info.sha1 |
The hash of the file |
file_info.display_name |
The name of the file as provided by the owner |
scan_results.total_avs |
The total number of anti-malware engines that scanned this file |
scan_results.total_detected_avs |
The total number of anti-malware engines that detected this file as being infected |
scan_results.scan_all_result_i |
The scan results from multiscanning. See scan result codes. |
scan_results.start_time |
Time of scan |
sanitized.data_id |
The data_id of the sanitized version of the file |
sanitized.result |
The result of the sanitized file |
sanitized.reason |
If the file failed to sanitize, the reason is provided here. |
Errors
Please refer to Errors for more information.
Sample code (NodeJS)
var http = require(
"https"
);
var options = {
"method"
:
"GET"
,
"hostname"
: [
"api"
,
"metadefender"
,
"com"
],
"path"
: [
"v4"
,
"feed"
,
"infected"
,
"latest"
],
"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 GET \
'https://api.metadefender.com/v4/apikey/scan-history?limit=50&offset=50'
\
-H
"apikey: ${APIKEY}"