# DescribeRequest

## 1. API Description

This API (DescribeRequest) is used to query the number of CDN requests, data aggregation internval is 5 minutes.

#### Preparation

* Query Billing Region: Use [`DescribeBillingRegions`](https://docs.console.zenlayer.com/test/ci-develop-en/networking/cdn/common/describebillingregions).

## 2. Request Parameters

The following table lists the required request parameters for the API:

| Parameter Name | Required | Type   | Description                                                                                                                                                                                                                         |
| -------------- | -------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startTime      | Yes      | String | The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For example, 2024-08-22T00:00:00Z.                                                 |
| endTime        | Yes      | String | The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For example, 2024-08-22T00:10:00Z. Note: The end time must be later than the start time. |
| domain         | No       | String | Domain, use commas(,) to separate multiple domain names. By default, all acceleration domains will be queried.                                                                                                                      |
| region         | No       | String | [Billing region](https://docs.console.zenlayer.com/test/ci-develop-en/networking/cdn/common/describebillingregions)                                                                                                                 |
| protocol       | No       | String | [Protocol type](https://docs.console.zenlayer.com/test/ci-develop-en/networking/datastructure#protocolvalue)                                                                                                                        |

## 3. Output Parameterss

| Parameter Name | Type                                                                                                                | Description                                                                                          |
| -------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| dataSet        | Array of [BandwithData](https://docs.console.zenlayer.com/test/ci-develop-en/networking/datastructure#bandwithdata) | Number of requests.                                                                                  |
| requestId      | String                                                                                                              | Unique request ID, which is returned with every request. This request ID is needed to locate issues. |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}

1. **Query CDN Request Count.**

```json
POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/cdn
Content-Type: application/json
X-TC-Action: DescribeRequest
<Common Request Params>

Request:
{
    "startTime": "2024-08-22T00:00:00Z",
    "endTime": "2024-08-22T00:10:00Z"
}
Response:
{
    "requestId": "T747E3929-7A0E-XXXX-9BDC-2CFD2FD7E180",
    "response": {
        "requestId": "T747E3929-7A0E-XXXX-9BDC-2CFD2FD7E180",
        "dataSet": [
            {
                "data": [
                    {
                        "time": "2024-08-22T00:00:00Z",
                        "value": 101573
                    },
                    {
                        "time": "2024-08-22T00:05:00Z",
                        "value": 115754
                    }
                ],
                "domain": "www.xxx.com",
                "region": "ALL"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## 5. Error Codes

The following includes error codes encountered in business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/instruction/commonerrorcode).
