# Get channel traffic

## Get traffic usage of specified channel

<mark style="color:green;">`POST`</mark> `https://api.renlaer.com/V1/OpenApi/OpenApiGetUseTraffic`

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| UserId<mark style="color:red;">\*</mark>       | String | "Authentication" generated userId |
| Token<mark style="color:red;">\*</mark>        | String | "Authentication" generated token  |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json                  |

#### Request Body

| Name                                       | Type    | Description                                                                                                                                                                                                                                                         |
| ------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ChannelId                                  | Integer | If not filled, query the traffic used by all channels.                                                                                                                                                                                                              |
| DateType<mark style="color:red;">\*</mark> | String  | Available parameters: 1=today 2=last 7 days 3=last 30 days 4=custom. If custom type is selected you can provide StartTime and EndTime parameters or leave them empty and then they will have default values, sub-user creation date, and current date respectively. |
| StartTime                                  | date    | Use date format yyyy-mm-dd                                                                                                                                                                                                                                          |
| EndTime                                    | date    | Use date format yyyy-mm-dd                                                                                                                                                                                                                                          |

{% tabs %}
{% tab title="200: OK "Code":1000,"Message":"Successful"" %}

```json
{
    "Code": 1000,
    "Message": "Successful",
    "Data": {
        "Items": [
            {
                "ChannelId": 8,
                "UseTraffic": 0.00000,
                "UseTime": "2023-07-29T00:00:00"
            }
        ],
        "UseTrafficGb": {
            "TotalTrafficGb": 0.00000
        }
    }
}

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.renlaer.com/reference/api-reference/get-channel-traffic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
