10.1 Scan with sandbox

This is a BETA version. The API might change without notice.

Request

Value

Method

POST

URL

https://api.metadefender.com/v4/sandbox/:dataId/scan

Summary

The endpoint allows initiating a scan with the sandbox for a file with a particular dataId. This applies for files that were already uploaded using the file upload API.

Request

URL Parameters

 

Description

Example

:dataId

the dataId received on upload

bzE5MDIwN3J5N0pOZHVZVkVIMVZKVmRkSzRW

Header Parameters

 

Description

Allowed Values

Required

apikey

gives rights to use the endpoint (token authentication) (API Authentication Mechanisms)

apikey

YES

sandbox

the OS for which the sandbox scan is performed

windows7; windows10

YES

Response

HTTP Status Codes

Please refer to Status Codes for more information.

Body

Example of a successful request:

{
"md5": "CD1DA8C0332DD43BCB4DA69033B4624D",
"sha1": "AAA1C1CF2E78F64C0894EBC568B145039BB06DC3",
"sha256": "A4512C42AAC49E253F7F1F2BF44759704F98F5ADE4F13AA664D71AF4B830DB1D",
"data_id": "bzE5MDIwN3J5N0pOZHVZVkVIMVZKVmRkSzRW",
"sandbox_id": "5cb48dbd99d46b000d1f617e"
}

Example of failed scan request:

{
"success": false,
"error": {
"code": 404001,
"messages": [
"Entity was not found"
],
"details": {
"message": "Entity was not found",
"name": "Client Error",
"code": 404001,
"status": 404
}
}
}

Descriptions of responses:

md5

md5 of the file

sha1

sha1 of the file

sha256

sha256 of the file

data_id

data_id of the file

sandbox_id

unique identifier for sandbox analysis , used for polling the 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": [
"v4",
"sandbox",
"bzE5MDIwN3J5N0pOZHVZVkVIMVZKVmRkSzRW",
"scan"
],
"headers": {
"apikey": process.env.APIKEY,
"sandbox": "windows7"
}
};
 
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 POST \
https://api.metadefender.com/v4/sandbox/bzE5MDIwN3J5N0pOZHVZVkVIMVZKVmRkSzRW/scan \
-H "apikey: ${APIKEY}" \
-H "sandbox: windows7"