# Channels

## List the channels in this project

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

This endpoint allows you to get free cakes.

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | string | The project id |

#### Query Parameters

| Name          | Type   | Description                                                        |
| ------------- | ------ | ------------------------------------------------------------------ |
| state         | string | All,Running,Timeout,Paused,Invalid URL,Mute,Other.  Default is All |
| timemap       | string | 0 or 1                                                             |
| search\_type  | string | channel\_id, channel\_name, city, custom\_id, mytuner\_id          |
| search\_value | string |                                                                    |
| page          | number | The page number                                                    |

#### Headers

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

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "data": [
        {
            "uid": 19,
            "project_id": 179,
            "id": 100251,
            "type": "Radio",
            "name": "BBC Radio 1",
            "sub_title": "London - 98.8 FM",
            "language": "English",
            "city": "London",
            "province": null,
            "country": "United Kingdom",
            "continent": "Europe",
            "website": "http://www.bbc.co.uk/radio1",
            "twitter": "http://twitter.com/BBCR1",
            "mytuner": "https://mytuner-radio.com/radio/409791",
            "urls": [],
            "status_code": 0,
            "monitor_at": "2018-02-26 07:56:50",
            "timemap": 0,
            "user_defined": [],
            "add_at": "2020-03-25 00:00:00"
        },
        {
            "uid": 19,
            "project_id": 179,
            "id": 100252,
            "type": "Radio",
            "name": "BBC Radio 2",
            "sub_title": "London - 89.1 FM",
            "language": "English",
            "city": "London",
            "province": null,
            "country": "United Kingdom",
            "continent": "Europe",
            "website": "http://www.bbc.co.uk/radio2",
            "twitter": "http://twitter.com/BBCRadio2",
            "mytuner": "https://mytuner-radio.com/radio/409758",
            "urls": [],
            "status_code": 0,
            "monitor_at": "2018-02-26 07:56:50",
            "timemap": 0,
            "user_defined": [],
            "add_at": "2020-03-25 00:00:00"
        }
    ],
    "links": {
        "first": "https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels?page=1",
        "last": "https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels",
        "per_page": 50,
        "to": 2,
        "total": 2
    }
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request GET 'https://api-v2.acrcloud.com/api/bm-bd-projects/179/channels' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}'
```

{% endtab %}
{% endtabs %}

## Add channels to your project

<mark style="color:green;">`POST`</mark> `https://api-v2.acrcloud.com/api/bm-bd-projects/:pid/channels`

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| pid  | number | The project id |

#### Headers

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

#### Request Body

| Name     | Type   | Description       |
| -------- | ------ | ----------------- |
| channels | string | channel\_id array |

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

```
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request POST 'https://api-v2.acrcloud.com/api/bm-bd-projects/12345/channels' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}' \
--header 'Content-Type: application/json' \
--data-raw '{"channels": [238766]}'
```

{% endtab %}
{% endtabs %}

## Delete channels from your project

<mark style="color:red;">`DELETE`</mark> `https://api-v2.acrcloud.com/api/bm-bd-projects/:pid/channels/:channel_ids`

#### Path Parameters

| Name         | Type   | Description                  |
| ------------ | ------ | ---------------------------- |
| pid          | string | The project id               |
| channel\_ids | string | One or multiple channel ids, |

#### Headers

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

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

```
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request DELETE 'https://api-v2.acrcloud.com/api/bm-bd-projects/12345/channels/238766?is_marked=0' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your token}' \
```

{% endtab %}
{% endtabs %}

## Set custom\_id for channel

<mark style="color:green;">`POST`</mark> `https://api-v2.acrcloud.com/api/bm-bd-projects/:pid/channels/:channel_id/user-defined`

#### Path Parameters

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

#### Query Parameters

| Name       | Type   | Description             |
| ---------- | ------ | ----------------------- |
| custom\_id | string | Custom ID, can be empty |

#### Headers

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

**Response**

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

```json
{
    "data": {
        "uid": 72,
        "project_id": 3086,
        "id": 219046,
        "type": "Radio",
        "name": "Cadena COPE",
        "sub_title": "Madrid - 999 AM",
        "language": "",
        "city": "Madrid",
        "province": null,
        "country": "Spain",
        "continent": "Europe",
        "website": "http://www.cope.es/",
        "twitter": "https://twitter.com/cope_es",
        "mytuner": "https://mytuner-radio.com/radio/410556",
        "urls": [],
        "status_code": 0,
        "monitor_at": "2019-06-06 08:55:41",
        "timemap": 0,
        "timemap_lifecycle": null,
        "coversong": 0,
        "coversong_at": "",
        "user_defined": {
            "id": "custom_id"
        },
        "add_at": "2025-02-24 06:45:10"
    }
}
```

{% endtab %}
{% endtabs %}
