# File

## Get File

<mark style="color:blue;">`GET`</mark> `https://api.yuudrive.me/v1/file/:id`

This endpoint allows you to get file.

#### Path Parameters

| Name                                 | Type   | Description     |
| ------------------------------------ | ------ | --------------- |
| id<mark style="color:red;">\*</mark> | string | ID of the file. |

#### Headers

| Name                                     | Type   | Description           |
| ---------------------------------------- | ------ | --------------------- |
| apikey<mark style="color:red;">\*</mark> | string | Authentication token. |

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

```javascript
{
    "code": 200,
    "result": {
        "id": "5520f5b3",
        "file_id": "1I1jgv6saHm4Sw5WazLGSPeXXpPb5xX_VX",
        "file_name": "Digital Photobook.pdf",
        "file_owner_mail": "youremail@gmail.com",
        "file_type": "application/pdf",
        "file_size": 8948521,
        "direct_dl": 1,
        "status": 1,
        "created_date": "2020-08-19T12:08:20.000Z",
        "downloads": 10,
        "download_today": 5,
        "last_download_date": null
    }
}
```

{% endtab %}

{% tab title="403 If the file is not yours." %}

```javascript
{
    "code": 403,
    "message": "You cannot see this file"
}
```

{% endtab %}

{% tab title="404 Could not find a file matching this query." %}

```javascript
{
    "code": 404,
    "message": "Not found"
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

```javascript
{
    "code": 401,
    "message": "Require an API Key",
}
```

{% endtab %}
{% endtabs %}

## Get Direct Download Link

<mark style="color:blue;">`GET`</mark> `https://api.yuudrive.me/v1/file/direct-dl`

#### Query Parameters

| Name                                  | Type   | Description       |
| ------------------------------------- | ------ | ----------------- |
| url<mark style="color:red;">\*</mark> | String | Google Drive URL. |

#### Headers

| Name                                     | Type   | Description           |
| ---------------------------------------- | ------ | --------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Authentication token. |

{% tabs %}
{% tab title="200: OK Response OK" %}
{% code overflow="wrap" %}

```javascript
{
  "code": 200,
  "message": "OK",
  "result": {
    "status": "READY",
    "file": {
      "name": "[Filename].mp4",
      "mimeType": "video/mp4",
      "fullFileExtension": "mp4",
      "md5Checksum": "a2ec4ea33e3830540bc26a3b7805a61a",
      "size": "4543271559"
    },
    "realUrl": "https://docs.google.com/uc?id=1wRE38ddGKzXXxX1rfny4orrzVTD60kxxXXXxxX&export=download",
    "resultUrl": "https://doc-0k-5o-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/gt4dahq335pvscm4mtghcevmo7ni1chb/1663868250000/17931711697288872411/*/1wRE38ddGKzXXxX1rfny4orrzVTD60kxxXXXxxX?e=download&uuid=d3c2f5d2-29fb-49e1-99ca-745192da3191"
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found Response Not Found" %}

```javascript
{
    "code": 404,
    "message": "Not found"
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized" %}

```javascript
{
    "code": 401,
    "message": "Require an API Key",
}
```

{% endtab %}
{% endtabs %}
