# API Endpoints

## Update Servercount

<mark style="color:purple;">`PATCH`</mark> `https://api.discord-botlist.eu/v1/update`

This endpoint allows you to get free cakes.

#### Headers

| Name                                            | Type   | Description                                                        |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Authentication token to identify your bot. We use Bearer as method |

#### Request Body

| Name                                          | Type   | Description                                |
| --------------------------------------------- | ------ | ------------------------------------------ |
| serverCount<mark style="color:red;">\*</mark> | number | Your new servercount. MUST BE SEND AS JSON |

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

```
{"updated": [ "SERVER_COUNT" ]}
```

{% endtab %}

{% tab title="403 Could not authorize you" %}

```
{"message":"'authorization' header is missing"}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    message: "Servercount must be a number! Got undefined"
    //This usually means that your body is wrongly encoded. Try adding "Content-Type: application/json" to your request header and make sure you are not sending the data as a string
}
```

{% endtab %}
{% endtabs %}

## Get all Votes

<mark style="color:blue;">`GET`</mark> `https://api.discord-botlist.eu/v1/votes`

#### Headers

| Name          | Type   | Description                                                        |
| ------------- | ------ | ------------------------------------------------------------------ |
| Authorization | string | Authentication token to identify your bot. We use Bearer as method |

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

```
[
    "2021-06-12T12:00:29.893Z",
    "..."
]
```

{% endtab %}

{% tab title="403 " %}

```
{"message":"'authorization' header is missing"}
```

{% endtab %}
{% endtabs %}

## Get all botdata

<mark style="color:blue;">`GET`</mark> `https://api.discord-botlist.eu/v1/ping`

#### Headers

| Name          | Type   | Description                                                        |
| ------------- | ------ | ------------------------------------------------------------------ |
| Authorization | string | Authentication token to identify your bot. We use Bearer as method |

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

```
{
    "discord": {
        "id": "1234324234234234,
        "username": "TestBot",
        "discriminator": "2998",
        "tag": "TestBot#2998"
    },
    "botlist": {
        "serverCount": null,
        "developer": {
            "main": "843567384657832342",
            "additional": [
                ""
            ]
        },
        "upvotes": [
            "2021-06-12T12:00:29.893Z",
            "2021-07-11T13:25:33.807Z",
            "2021-07-12T02:32:53.840Z",
            "2021-07-12T02:35:39.727Z",
            "2021-08-01T15:44:23.285Z"
        ],
        "flags": [
            "CERTIFIED",
            "BANNER_GIF"
        ],
        "banner": "https://example.com",
        "website": "https://example.com",
        "prefix": "!",
        "longdesc": "Longdesc",
        "shortdesc": "Shortdesc",
        "invite": "https://example.com",
        "vanity": "test_bot",
        "theme": "#0073ff"
    }
}
```

{% endtab %}

{% tab title="403 " %}

```
{"message":"'authorization' header is missing"}
```

{% endtab %}
{% endtabs %}
