# Channels State

## Get the state of the channel

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/bm-bd-projects/:pid/channels/:channel_id/state`

#### Path Parameters

| Name        | Type   | Description    |
| ----------- | ------ | -------------- |
| pid         | number | The project id |
| channel\_id | number | The channel id |

#### Query Parameters

| Name        | Type   | Description                                                                                               |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------- |
| timeoffset  | string | Time offset from UTC(e.g: The timeoffset of Tokyo(UTC+9) is -540, the timeoffset of Dubai(UTC+4) is -240) |
| start\_date | string | Start date(YYYYmmdd, e.g: 20210301)                                                                       |
| end\_date   | string | End date(YYYYmmdd, e.g: 20210302)                                                                         |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Authorization | string | Bearer token     |
| Accept        | string | application/json |

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

```
{
  "data": {
    "total_time": 318895,
    "valid_time": 312323,
    "timeoffset": 0,
    "state_list": [
      {
        "code": 0,
        "start": "2021-03-26 00:00:00",
        "end": "2021-03-26 00:06:38",
        "duration": 398
      },
      {
        "code": 12,
        "start": "2021-03-26 00:06:38",
        "end": "2021-03-26 00:10:58",
        "duration": 260
      },
      {
        "code": 0,
        "start": "2021-03-26 00:10:58",
        "end": "2021-03-26 00:19:40",
        "duration": 522
      },
      {
        "code": 12,
        "start": "2021-03-26 00:19:40",
        "end": "2021-03-26 00:21:10",
        "duration": 90
      },
      {
        "code": 0,
        "start": "2021-03-26 00:21:10",
        "end": "2021-03-26 00:45:19",
        "duration": 1449
      },
      {
        "code": 12,
        "start": "2021-03-26 00:45:19",
        "end": "2021-03-26 01:10:54",
        "duration": 1535
      },
      {
        "code": 0,
        "start": "2021-03-26 01:10:54",
        "end": "2021-03-26 01:15:55",
        "duration": 301
      },
      {
        "code": 12,
        "start": "2021-03-26 01:15:55",
        "end": "2021-03-26 02:31:12",
        "duration": 4517
      },
      {
        "code": 0,
        "start": "2021-03-26 02:31:12",
        "end": "2021-03-26 02:56:40",
        "duration": 1528
      },
      {
        "code": 12,
        "start": "2021-03-26 02:56:40",
        "end": "2021-03-26 02:56:50",
        "duration": 10
      },
      {
        "code": 0,
        "start": "2021-03-26 02:56:50",
        "end": "2021-03-26 03:30:52",
        "duration": 2042
      },
      {
        "code": 12,
        "start": "2021-03-26 03:30:52",
        "end": "2021-03-26 03:31:01",
        "duration": 9
      },
      {
        "code": 0,
        "start": "2021-03-26 03:31:01",
        "end": "2021-03-26 04:11:00",
        "duration": 2399
      },
      {
        "code": 12,
        "start": "2021-03-26 04:11:00",
        "end": "2021-03-26 04:11:09",
        "duration": 9
      },
      {
        "code": 0,
        "start": "2021-03-26 04:11:09",
        "end": "2021-03-26 05:58:13",
        "duration": 6424
      },
      {
        "code": 0,
        "start": "2021-03-26 05:58:13",
        "end": "2021-03-26 08:00:00",
        "duration": 7307
      },
      {
        "code": 0,
        "start": "2021-03-26 08:00:00",
        "end": "2021-03-27 08:00:00",
        "duration": 86400
      },
      {
        "code": 0,
        "start": "2021-03-27 08:00:00",
        "end": "2021-03-27 22:01:26",
        "duration": 50486
      },
      {
        "code": 1,
        "start": "2021-03-27 22:01:26",
        "end": "2021-03-27 22:02:26",
        "duration": 60
      },
      {
        "code": 0,
        "start": "2021-03-27 22:02:26",
        "end": "2021-03-27 22:02:47",
        "duration": 21
      },
      {
        "code": 1,
        "start": "2021-03-27 22:02:47",
        "end": "2021-03-27 22:03:00",
        "duration": 13
      },
      {
        "code": 0,
        "start": "2021-03-27 22:03:00",
        "end": "2021-03-28 08:00:00",
        "duration": 35820
      },
      {
        "code": 0,
        "start": "2021-03-28 08:00:00",
        "end": "2021-03-29 05:46:49",
        "duration": 78409
      },
      {
        "code": 1,
        "start": "2021-03-29 05:46:49",
        "end": "2021-03-29 05:47:57",
        "duration": 68
      },
      {
        "code": 0,
        "start": "2021-03-29 05:47:57",
        "end": "2021-03-29 08:00:00",
        "duration": 7923
      },
      {
        "code": 0,
        "start": "2021-03-29 08:00:00",
        "end": "2021-03-29 16:34:54",
        "duration": 30894
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects/1234/channels/295704/state?timeoffset=0&start_date=20210301&end_date=20210302' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}'
```

{% endtab %}
{% endtabs %}

## The details of the state code

| Code | Name        |
| ---- | ----------- |
| 0    | Running     |
| 1    | Timeout     |
| 4    | Paused      |
| 6    | Invalid URL |
| 10   | Deleted     |
| 12   | Mute        |
