# BM Streams

## Import bm streams

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

Import BM streams to project

#### Path Parameters

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

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

#### Request Body

| Name            | Type   | Description              |
| --------------- | ------ | ------------------------ |
| bm\_stream\_ids | array  | The BM streams ids array |
| from            | string | BM-CUSTOM or BM-DATABASE |
| bm\_project\_id | number | The BM project id        |

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

```
{
    "data": [
        {
            "uid": 1,
            "pid": 10263,
            "bm_stream_id": 191149,
            "bm_project_id": 871,
            "from": "BM-DATABASE",
            "state": 1,
            "updated_at": "2020-12-28T08:01:14.000000Z",
            "created_at": "2020-12-28T08:01:14.000000Z",
            "id": 79,
            "bm_stream_name": "(ΛΑΜΨΗ) Lampsi 92.3 FM",
            "bm_project_name": "test"
        },
        {
            "uid": 1,
            "pid": 10263,
            "bm_stream_id": 198144,
            "bm_project_id": 871,
            "from": "BM-DATABASE",
            "state": 1,
            "updated_at": "2020-12-28T08:01:14.000000Z",
            "created_at": "2020-12-28T08:01:14.000000Z",
            "id": 80,
            "bm_stream_name": ".977 Today's Hits",
            "bm_project_name": "test"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request POST 'https://api-v2.acrcloud.com/api/ucf-projects/10263/streams' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"bm_stream_ids":["191149","198144"], "from":"BM-DATABASE", "bm_project_id":871}'
```

{% endtab %}
{% endtabs %}

## List the ucf streams

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

#### Path Parameters

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

#### Query Parameters

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| page      | number |             |
| per\_page | number |             |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

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

```
{
    "data": [
        {
            "id": 80,
            "uid": 1,
            "pid": 10263,
            "bm_stream_id": "198144",
            "bm_project_id": 871,
            "from": "BM-DATABASE",
            "state": 1,
            "updated_at": "2020-12-28T08:01:14.000000Z",
            "created_at": "2020-12-28T08:01:14.000000Z",
            "bm_stream_name": ".977 Today's Hits",
            "bm_project_name": "test"
        },
        {
            "id": 79,
            "uid": 1,
            "pid": 10263,
            "bm_stream_id": "191149",
            "bm_project_id": 871,
            "from": "BM-DATABASE",
            "state": 1,
            "updated_at": "2020-12-28T08:01:14.000000Z",
            "created_at": "2020-12-28T08:01:14.000000Z",
            "bm_stream_name": "(ΛΑΜΨΗ) Lampsi 92.3 FM",
            "bm_project_name": "test"
        }
    ],
    "links": {
        "first": "http://127.0.0.1:8080/api/ucf-projects/10263/streams?page=1",
        "last": "http://127.0.0.1:8080/api/ucf-projects/10263/streams?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http://127.0.0.1:8080/api/ucf-projects/10263/streams",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request GET 'https://api-v2.acrcloud.com/api/ucf-projects/10263/streams' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
```

{% endtab %}
{% endtabs %}

## Delete the bm streams

<mark style="color:red;">`DELETE`</mark> `https://api-v2.acrcloud.com/api/ucf-projects/:pid/streams/ids`

#### Path Parameters

| Name | Type   | Description                      |
| ---- | ------ | -------------------------------- |
| ids  | string | The streams ids. Sparated by ',' |
| pid  | number | The ucf project id               |

#### Headers

| Name          | Type   | Description  |
| ------------- | ------ | ------------ |
| Authorization | string | Bearer token |

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

```
```

{% endtab %}
{% endtabs %}

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

```bash
curl --location --request DELETE 'http://127.0.0.1:8080/api/ucf-projects/10263/streams/80' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
```

{% endtab %}
{% endtabs %}
