10.1 Scan with sandbox

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. For information on how to upload a file for scanning with sandbox see 2.1 Scanning a file by file upload.

Request

URL Parameters

 

Description

Example

:dataId

the dataId received on upload

bzE5MDIwN3J5N0pOZHVZVkVIMVZKVmRkSzRW

Header Parameters

 

Description

Allowed Values

Required

apikey

Identifies and authorizes the user (API Authentication Mechanisms)

apikey

YES

sandbox

the OS for which the sandbox scan is performed

windows7; windows10

YES

sandbox_timeout

Specifies for how long the file should be analized on the sandbox. Short=150s, long=300s.

short; long

NO

sandbox_browser

What browser to use when uploading html/JavaScript files or analyzing URLs.

os_default, chrome, firefox

NO

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:

{
"error": {
"code": 404001,
"messages": [
"Entity was not found"
]
}
}

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"