Get Scan
client.vulnerabilityScanner.scans.get(stringscanId, ScanGetParams { account_id } params?, RequestOptionsoptions?): ScanGetResponse { id, scan_type, status, 2 more }
GET/accounts/{account_id}/vuln_scanner/scans/{scan_id}
Returns a single scan by ID.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Get Scan
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const scan = await client.vulnerabilityScanner.scans.get('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
console.log(scan.id);{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"scan_type": "bola",
"status": "created",
"target_environment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"report": {
"report": {
"summary": {
"verdict": "ok"
},
"tests": [
{
"steps": [
{
"assertions": [
{
"description": "description",
"kind": {
"parameters": {
"max": 0,
"min": 0
},
"type": "http_status_within_range"
},
"observed": 0,
"outcome": "ok"
}
],
"errors": [
{
"description": "description",
"error_code": 0
}
],
"request": {
"credential_set": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"role": "owner"
},
"header_names": [
"string"
],
"method": "GET",
"url": "https://example.com",
"variable_captures": [
{
"json_path": "json_path",
"name": "name"
}
],
"body": {}
},
"response": {
"body": {
"kind": "not_found"
},
"header_names": [
"string"
],
"status": 0,
"status_text": "status_text"
}
}
],
"verdict": "ok",
"preflight_errors": [
{
"description": "description",
"error_code": 0
}
]
}
]
},
"report_schema_version": "v1"
}
},
"result_info": {}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"scan_type": "bola",
"status": "created",
"target_environment_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"report": {
"report": {
"summary": {
"verdict": "ok"
},
"tests": [
{
"steps": [
{
"assertions": [
{
"description": "description",
"kind": {
"parameters": {
"max": 0,
"min": 0
},
"type": "http_status_within_range"
},
"observed": 0,
"outcome": "ok"
}
],
"errors": [
{
"description": "description",
"error_code": 0
}
],
"request": {
"credential_set": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"role": "owner"
},
"header_names": [
"string"
],
"method": "GET",
"url": "https://example.com",
"variable_captures": [
{
"json_path": "json_path",
"name": "name"
}
],
"body": {}
},
"response": {
"body": {
"kind": "not_found"
},
"header_names": [
"string"
],
"status": 0,
"status_text": "status_text"
}
}
],
"verdict": "ok",
"preflight_errors": [
{
"description": "description",
"error_code": 0
}
]
}
]
},
"report_schema_version": "v1"
}
},
"result_info": {}
}