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; windows 10

YES

Response

HTTP Status Codes

Please refer to Status Codes for more information.

Body

Example of a successful request:

{
"apikey": "40721321d154d1e5fd20c3b3cacb22bd",
"md5": "CD1DA8C0332DD43BCB4DA69033B4624D",
"sha1": "AAA1C1CF2E78F64C0894EBC568B145039BB06DC3",
"sha256": "A4512C42AAC49E253F7F1F2BF44759704F98F5ADE4F13AA664D71AF4B830DB1D",
"dataId": "bzE5MDIwN3J5N0pOZHVZVkVIMVZKVmRkSzRW",
"_id": "5c6be85931fa55001e5e194d"
}

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:

apikey

t he apikey that initiated the request

md5

md5 of file

sha1

sha1 of file

sha256

sha256 of file

dataId

dataId of file

_id

unique identifier for sandbox analysis , used to poll lookup endpoint for 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"