# Shared Links

## Get Shared Links

<mark style="color:blue;">`GET`</mark> `https://api.couchdrop.io/manage/sharedlinks`

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

{% tabs %}
{% tab title="200 Returns list of shared links " %}

```
{
  "result": [
              {"account": "admin",
                "expiry": 86400,
                "id": "94a4235b-c4ae-4ded-b31a-c7d0e29844b9",
                "password": "P@ssw0rd",
                "path": "/google/folder1"},
              {"account": "admin",
                "expiry": 0,
                "id": "a6f1cd25-bba2-453f-b9cd-d369c6ce5693",
                "password": "",
                "path": "/onedrive/accounts.pdf"}
             ]
 }
```

{% endtab %}
{% endtabs %}

## Add Shared Link

<mark style="color:orange;">`PUT`</mark> `https://api.couchdrop.io/manage/sharedlinks`

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

{% tabs %}
{% tab title="200 Returns newly created shared link object" %}

```
{
    "result": {
             "account": "admin",
             "expiry": 0,
             "id": "e2a460ed-af5b-4af4-bcf5-c07accab8dde",
             "password": "",
             "path": "/"
             }
}
```

{% endtab %}
{% endtabs %}

## Update Shared Link

<mark style="color:green;">`POST`</mark> `https://api.couchdrop.io/manage/sharedlinks`

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

#### Request Body

| Name     | Type   | Description                                                   |
| -------- | ------ | ------------------------------------------------------------- |
| id       | string | Shared link identifier, generated by the system               |
| expiry   | string | Expiration time for shared link (epoch time ie: '1606087502') |
| password | string | Password to protect shared link                               |
| path     | string | Path to file / folder that will be shared                     |

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

```
{}
```

{% endtab %}
{% endtabs %}

## Delete Shared Link

<mark style="color:red;">`DELETE`</mark> `https://api.couchdrop.io/manage/sharedlinks/<link_id>`

#### Path Parameters

| Name     | Type   | Description                     |
| -------- | ------ | ------------------------------- |
| link\_id | string | ID of shared link to be deleted |

#### Headers

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| token | string | API Access Token |

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

```
{}
```

{% endtab %}
{% endtabs %}
