# Musical

## Get info of all musicals

<mark style="color:blue;">`GET`</mark> `/musical/main`

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

```
{
    data: [all musicals]
    message: "ok"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    message:"internal server error"
}
```

{% endtab %}
{% endtabs %}

## Get info of a single musical (by click)

<mark style="color:blue;">`GET`</mark> `/musical/:title`

API for clicking a musical card.

#### Path Parameters

| Name  | Type   | Description        |
| ----- | ------ | ------------------ |
| title | string | title of a musical |

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

```
{
    data: selected musical data
    message:"ok"
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    message: "musical not found"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    message:"internal server error"
}
```

{% endtab %}
{% endtabs %}

## Search by title (from search bar)

<mark style="color:blue;">`GET`</mark> `/musical?title="abc"`

API for search bar and autocompletion

#### Query Parameters

| Name  | Type   | Description      |
| ----- | ------ | ---------------- |
| title | string | search bar input |

{% tabs %}
{% tab title="200 array of matched musicals" %}

```
{
    data: [musical, ...]
    message: "ok"
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    message: "not found"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    message: "internal server error"
}
```

{% endtab %}
{% endtabs %}

## Add Bookmark

<mark style="color:green;">`POST`</mark> `/musical/bookmark`

#### Request Body

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| title | string |             |

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

```
{
    data: bookmarked musical
    message: "ok"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    message: "internal server error"
}
```

{% endtab %}
{% endtabs %}

## Delete Bookmark

<mark style="color:red;">`DELETE`</mark> `/musical/bookmark/:title`

#### Path Parameters

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| title | string |             |

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

```
{
    message: "ok"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
    message: "internal server error"
}
```

{% endtab %}
{% endtabs %}
