Help Center/ Web Application Firewall/ API Reference (Paris)/ APIs/ Dedicated Mode/ Dashboard/ Querying the Number of Requests and Attacks on Dashboard
Updated on 2024-07-25 GMT+08:00

Querying the Number of Requests and Attacks on Dashboard

Function

This API is used to query the number of requests and attacks on the dashboard. This API and other APIs related to Dashboard cannot be used to query the number of requests or attacks for a custom time range. You can use them to query statistics for yesterday, today, past 3 days, past 7 days, and past 30 days only.

URI

GET /v1/{project_id}/waf/overviews/statistics

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

ID of the enterprise project. It can be obtained by calling the ListEnterpriseProject API of EPS.

from

Yes

Long

Start time (13-digit timestamp). This parameter must be used together with to.

to

Yes

Long

End time (13-digit timestamp). This parameter must be used together with from.

hosts

No

String

Domain name ID array. In the cloud mode, it can be obtained by calling the ListHost API. In the dedicated mode, it can be obtained by calling the ListPremiumHost API. By default, it is left empty, and statistics on abnormal requests for all domain names is returned. To query abnormal requests for one or more domain names, configure this parameter.

instances

No

String

List of instances to be queried

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Content-Type

Yes

String

Content type

Default: application/json;charset=utf8

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

[items]

Array of CountItem objects

Security statistics

Table 5 CountItem

Parameter

Type

Description

key

String

Type

num

Integer

Quantity

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Messages

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Messages

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Messages

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Messages

Example Requests

GET https://{Endpoint}/v1/{project_id}/waf/overviews/statistics?enterprise_project_id=0&from=1650470400196&to=1650522936196&hosts=1bac09440a814aa98ed08302c580a48b&hosts=5a532f83a2fb476ba51ca1de7b1ebc43

Example Responses

Status code: 200

ok

[ {
  "key" : "ACCESS",
  "num" : 1190
}, {
  "key" : "PRECISE",
  "num" : 0
}, {
  "key" : "CRAWLER",
  "num" : 10
}, {
  "key" : "WEB_ATTACK",
  "num" : 22
}, {
  "key" : "CC",
  "num" : 0
}, {
  "key" : "ATTACK",
  "num" : 32
} ]

Status Codes

Status Code

Description

200

ok

400

Request failed.

401

The token does not have required permissions.

403

Insufficient resource quota.

500

Internal server error.

Error Codes

See Error Codes.