# File Scanning

## Create a FS container

<mark style="color:green;">`POST`</mark> `https://api-v2.acrcloud.com/api/fs-containers`

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer your\_token |

#### Request Body

| Name                                          | Type   | Description                                                                                                                                                                 |
| --------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>        | String | Your container name                                                                                                                                                         |
| region<mark style="color:red;">\*</mark>      | String | eu-west-1,us-west-2,ap-southeast-1                                                                                                                                          |
| audio\_type<mark style="color:red;">\*</mark> | String | <p>linein or recorded. Default is linein <br>linein: Audio of original file or stream without noise</p><p>recorded: Audio captured via microphone or noisy audio files </p> |
| buckets<mark style="color:red;">\*</mark>     | Array  | <p>The project detects content from the buckets.  The format is bucket id/name array.  For example:<br>\[8881,8882,"ACRCloud Music"]<br></p>                                |
| engine<mark style="color:red;">\*</mark>      | Number | <p>1:Audio Fingerprinting<br>2:Cover Songs<br>3:Audio Fingerprinting & Cover songs<br>4:Speech to Text</p>                                                                  |
| policy<mark style="color:red;">\*</mark>      | JSON   | <p>{"type":"traverse", "interval":0, "rec\_length:10}<br>or <br>{"type":"points", "points":3}</p>                                                                           |
| callback\_url                                 | String | Result callback url                                                                                                                                                         |
| deepright                                     | Bool   | <p>0 or 1<br>0: disable the derivative works detection<br>1:  enable the derivative works detection</p>                                                                     |
| music\_detection                              | Bool   | <p>0 or 1<br>0:  disable music/speech detection<br>1:  enable music/speech detection</p>                                                                                    |
| ai\_detection                                 | Bool   | <p>0 or 1<br>0: disable ai detection<br>1: enable ai detection</p>                                                                                                          |

{% tabs %}
{% tab title="201: Created " %}

````json
```json
{
    "data": {
        "id": 123456,
        "uid": 123,
        "region": "eu-west-1",
        "name": "container name",
        "buckets": [
            {
                "id": 23,
                "name": "ACRCloud Music",
                "type": "ACRCloudFile",
                "metadata_template": null
            }
        ],
        "audio_type": "linein",
        "num": 1,
        "size": 14,
        "policy": {
            "type": "traverse",
            "interval": 0,
            "rec_length": 10,
            "ai_detection": 1,
            "deepright":true
        },
        "engine": 1,
        "callback_url": null,
        "created_at": "2023-04-28T07:53:40.000000Z",
        "updated_at": "2023-04-28T07:53:40.000000Z"
    }
}
```
````

{% endtab %}
{% endtabs %}

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

```python
import requests

url = "https://api-v2.acrcloud.com/api/fs-containers"

payload={
  "name":"test", 
  "region":"eu-west-1", 
  "buckets":[8881,8882,"ACRCloud Music"],
  "audio_type":"linein",
  "engine":1,
  "policy":{"type":"traverse", "interval":0, "rec_length":10}
}
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer token',
  'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, json=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

## Get all the containers

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/fs-containers`

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer your\_token |
| Content-Type                                    | String | application/json   |

#### Query Parameters

| Name   | Type   | Description                                                                          |
| ------ | ------ | ------------------------------------------------------------------------------------ |
| region | String | <p>list the continers in the region.<br>eu-west-1<br>us-west-2<br>ap-southeast-1</p> |
| name   | String | search by name                                                                       |

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

{% endtab %}
{% endtabs %}

## Update a container

<mark style="color:blue;">`PUT`</mark> `https://api-v2.acrcloud.com/api/fs-containers/:container_id`

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer your\_token |
| Content-Type                                    | String | application/json   |

#### Request Body

| Name             | Type   | Description                                                                                                                                                                 |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name             | String | Your container name                                                                                                                                                         |
| audio\_type      | String | <p>linein or recorded. Default is linein <br>linein: Audio of original file or stream without noise</p><p>recorded: Audio captured via microphone or noisy audio files </p> |
| buckets          | Array  | <p>The project detects content from the buckets.  The format is bucket id/name array.  For example:<br>\[8881,8882,"ACRCloud Music"]<br></p>                                |
| engine           | Number | <p>1:Audio Fingerprinting<br>2:Cover Songs<br>3:Audio Fingerprinting & Cover songs<br>4:Speech to Text</p>                                                                  |
| policy           | JSON   | <p>{"type":"traverse", "interval":0, "rec\_length:10}<br>or <br>{"type":"points", "points":3}</p>                                                                           |
| callback\_url    | String | Result callback url                                                                                                                                                         |
| deepright        | Bool   | <p>0 or 1<br>0: disable the derivative works detection<br>1:  enable the derivative works detection</p>                                                                     |
| music\_detection | Bool   | <p>0 or 1<br>0:  disable music/speech detection<br>1:  enable music/speech detection</p>                                                                                    |
| ai\_detection    | Bool   | <p>0 or 1<br>0: disable ai detection<br>1: enable ai detection</p>                                                                                                          |

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

```python
import requests

url = "https://api-v2.acrcloud.com/api/fs-containers/123456"

payload={
  "name":"test", 
  "buckets":["ACRCloud Music"],
  "audio_type":"linein",
  "engine":1,
  "policy":{"type":"traverse", "interval":0, "rec_length":10},
  "deepright":1
}
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer token',
  'Content-Type': 'application/json'
}

response = requests.(url, headers=headers, json=payload)

print(response.text)
```

{% endtab %}
{% endtabs %}

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

````json
```json
{
    "data": {
        "id": 123456,
        "uid": 123,
        "region": "eu-west-1",
        "name": "container name",
        "buckets": [
            {
                "id": 23,
                "name": "ACRCloud Music",
                "type": "ACRCloudFile",
                "metadata_template": null
            }
        ],
        "audio_type": "linein",
        "num": 1,
        "size": 14,
        "policy": {
            "type": "traverse",
            "interval": 0,
            "rec_length": 10,
            "ai_detection": 1,
            "deepright":true
        },
        "engine": 1,
        "callback_url": null,
        "created_at": "2023-04-28T07:53:40.000000Z",
        "updated_at": "2023-04-28T07:53:40.000000Z"
    }
}
```
````

{% endtab %}
{% endtabs %}

## Show one container

<mark style="color:blue;">`GET`</mark> `https://api-v2.acrcloud.com/api/fs-containers/:container_id`

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer your\_token |
| Content-Type                                    | String | application/json   |

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

```
{
    "data": {
        "id": 123456,
        "uid": 123,
        "region": "eu-west-1",
        "name": "container name",
        "buckets": [
            {
                "id": 23,
                "name": "ACRCloud Music",
                "type": "ACRCloudFile",
                "metadata_template": null
            }
        ],
        "audio_type": "linein",
        "num": 1,
        "size": 14,
        "policy": {
            "type": "traverse",
            "interval": 0,
            "rec_length": 10
        },
        "engine": 1,
        "callback_url": null,
        "created_at": "2023-04-28T07:53:40.000000Z",
        "updated_at": "2023-04-28T07:53:40.000000Z"
    }
}
```

{% endtab %}
{% endtabs %}

## Delete one container

<mark style="color:red;">`DELETE`</mark> `https://api-v2.acrcloud.com/api/fs-containers/:container_id`

#### Path Parameters

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| container\_id<mark style="color:red;">\*</mark> | Number | The Container ID |

#### Headers

| Name                                            | Type   | Description        |
| ----------------------------------------------- | ------ | ------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer your\_token |
| Content-Type                                    | String | application/json   |

{% tabs %}
{% tab title="204: No Content " %}

```
```

{% endtab %}
{% endtabs %}
