> For the complete documentation index, see [llms.txt](https://issy.gitbook.io/quotify/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://issy.gitbook.io/quotify/master.md).

# Methods

## Get random quotes

<mark style="color:blue;">`GET`</mark> `https://quotify.issy.dev/api/v1/get-random-quotes`

Returns random quotes

#### Query Parameters

| Name | Type    | Description                                                         |
| ---- | ------- | ------------------------------------------------------------------- |
| n    | integer | Amount of quote objects to be returned. Capped at 50, defaults to 1 |

{% tabs %}
{% tab title="200 Quote(s) successfully retrieved.
This will always be an array, even for 1 quote" %}

```yaml
[Quote objects]
```

{% endtab %}

{% tab title="404 Could not find any quotes" %}

```yaml
{"message": "No quotes found"}
```

{% endtab %}
{% endtabs %}

## Get quote by ID

<mark style="color:blue;">`GET`</mark> `https://quotify.issy.dev/api/v1/get-quote-by-id`

Find a quote by the specified quote ID

#### Query Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| id   | string | Quote ID    |

{% tabs %}
{% tab title="200 Quote successfully retrieved" %}

```
Quote object
```

{% endtab %}

{% tab title="400 Returned if your request doesn't include a query string" %}

```yaml
{"message": "Query parameter missing"}
```

{% endtab %}

{% tab title="404 " %}

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

{% endtab %}
{% endtabs %}

## Search for quotes

<mark style="color:blue;">`GET`</mark> `https://quotify.issy.dev/api/v1/search`

This endpoint allows you to search for a quote by message content, user ID and username. It's a greedy search, meaning that it'll always search across all 3 of those parameters, and is case insensitive.

#### Query Parameters

| Name | Type   | Description   |
| ---- | ------ | ------------- |
| q    | string | Search string |

{% tabs %}
{% tab title="200 Quotes successfully retrieved. Quotes will still be in an array if there is only 1 quote retrieved." %}

```
[Quote objects]
```

{% endtab %}

{% tab title="400 Returned if the request is missing a search query." %}

```
{"message": "Missing search query"}
```

{% endtab %}

{% tab title="404 Returned if no quotes are found matching the search query." %}

```yaml
{"message": "No quotes found"}
```

{% endtab %}
{% endtabs %}

## Add quote

<mark style="color:green;">`POST`</mark> `https://quotify.issy.dev/api/v1/add-quote`

#### Headers

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

#### Request Body

| Name     | Type  | Description              |
| -------- | ----- | ------------------------ |
| messages | array | Array of message objects |

{% tabs %}
{% tab title="201 Quote successfully created" %}

```yaml
{
    "message": "Quote successfully created",
    "id": quote ID,
    "permalink": quote URL
}
```

{% endtab %}

{% tab title="400 Returned if a body field is missing or of the wrong type, or if there was no body attached to the request" %}

```
{"message": "Malformed request"}
```

{% endtab %}

{% tab title="403 Invalid authorization token provided, or no token provided" %}

```
{"message": "Not authorized"}
```

{% endtab %}
{% endtabs %}

## Delete quote

<mark style="color:red;">`DELETE`</mark> `https://quotify.issy.dev/api/v1/delete-quote`

#### Path Parameters

| Name      | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| quote\_id | string | ID of the quote to be deleted |

#### Headers

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

{% tabs %}
{% tab title="200 Quote successfully deleted" %}

```
{"message": "Quote with ID ${quote_id} successfullly deleted"}
```

{% endtab %}

{% tab title="403 Invalid authorization token provided, or no token provided" %}

```
{"message": "Not authorized"}
```

{% endtab %}

{% tab title="404 Returned if no quote with the specified ID was found" %}

```
{"message": "Quote with ID ${ID} not found"}
```

{% endtab %}
{% endtabs %}
