Querying Website Requests
Function
This API is used to query website requests. Note that APIs related to the dashboard cannot be used to query data for custom time. Only data displayed on the console for yesterday, today, past 3 days, past 7 days, and past 30 days can be queried.
URI
GET /v1/{project_id}/waf/overviews/request/timeline
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. To obtain it, go to Cloud management console and hover the cursor over your username. On the displayed window, choose My Credentials.Then, in the Projects area, view Project ID of the corresponding project. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
You can obtain the ID by calling the ListEnterpriseProject API of EPS. |
from |
Yes |
Long |
Start time (13-digit timestamp in millisecond). This parameter must be used together with to. |
to |
Yes |
Long |
End time (13-digit timestamp in millisecond). This parameter must be used together with from. |
hosts |
No |
Array |
Domain name IDs. In the cloud mode, domain name IDs can be obtained by calling the ListHost API. In the dedicated mode, domain name IDs can be obtained by calling the ListPremiumHost API. By default, this parameter is not required, and the statistics data of all protected domain names in the project is queried. To query data about several specified domain names, refer to the request example. |
instances |
No |
Array |
Instance IDs you want to query. This parameter is required only for dedicated WAF instances and load-balancing instances (ELB mode). |
group_by |
No |
String |
How data is displayed. To display data by the day, set the parameter to DAY. By default, this parameter is not specified, and data is displayed by the minute. |
Request 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
Parameter |
Type |
Description |
---|---|---|
[items] |
Array of StatisticsTimelineItem objects |
Request Timeline Data for Security Statistics. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Key value. The options are ACCESS for total requests, CRAWLER for bot mitigation, ATTACK for total attacks, WEB_ATTACK for basic web protection, PRECISE for precise protection, and CC for CC attack protection. |
timeline |
Array of TimeLineItem objects |
Statistics data over time for the corresponding key value |
Parameter |
Type |
Description |
---|---|---|
time |
Long |
Time point |
num |
Integer |
Statistics for the time range from the previous time point to the point specified by the time field. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error message |
Example Requests
GET https://{Endpoint}/v1/{project_id}/waf/overviews/request/timeline?enterprise_project_id=0&from=1650470400196&to=1650470450000
Example Responses
Status code: 200
ok
[ { "key" : "ACCESS", "timeline" : [ { "time" : 1650470400196, "num" : 0 } ] }, { "key" : "PRECISE", "timeline" : [ { "time" : 1650470400196, "num" : 0 } ] }, { "key" : "CRAWLER", "timeline" : [ { "time" : 1650470400196, "num" : 0 } ] }, { "key" : "CC", "timeline" : [ { "time" : 1650470400196, "num" : 0 } ] }, { "key" : "ATTACK", "timeline" : [ { "time" : 1650470400000, "num" : 0 } ] }, { "key" : "WEB_ATTACK", "timeline" : [ { "time" : 1650470400196, "num" : 0 } ] } ]
Status Codes
Status Code |
Description |
---|---|
200 |
ok |
400 |
Request failed. |
401 |
The token does not have required permissions. |
500 |
Internal server error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot