# ClickLogin - API

## Add site

<mark style="color:green;">`POST`</mark> `https://api.clicklogin.ru/api/addtoken`

Add your site to platform

#### Path Parameters

| Name   | Type   | Description              |
| ------ | ------ | ------------------------ |
| domain | string | Ex: <https://google.com> |

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

```
{
    "error": false,
    "message": "Domain successfully added. Please remember this token, you will never seen this again.",
    "data": {
        "token": "a24892d96a05f0536ac76a7facf95ebfe5a96df3745f8b1f80a466ca971225fbadff0c0268b2b058e8be300a0424f5a9e74677e0c2757e2e361438129d",
        "domain": "lolz.com"
    }
}
```

{% endtab %}

{% tab title="302 " %}

```
{
    "error": true,
    "message": "Heres your public token!",
    "data": {
        "id": 3,
        "token": "78b8b7dda709bc322050127fd7192351a54405052376d60857d396ed6699bbe53d04263177b9ce9f36299251d51d5920f4b44b27a802bd77c4f0536f5a"
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "error": true,
    "message": "This domain does not have a site or you can check it again.",
    "data": []
}
```

{% endtab %}
{% endtabs %}

## Stats

<mark style="color:blue;">`GET`</mark> `https://api.clicklogin.ru/api/stats`

Stats

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

```
{
    "domains": 45,
    "auths": 43929,
    "vk": 8,
    "fb": 0,
    "ok": 0,
    "gp": 0
}
```

{% endtab %}
{% endtabs %}

## Auth user (Ex: vk)&#x20;

<mark style="color:blue;">`GET`</mark> `https://api.clicklogin.ru/api/auth/[AUTH_TYPE]?domain=[DOMAIN]&redirect=[REDIRECT_URL]&token=[CLICK_LOGIN_TOKEN]`

Supported \[AUTH\_TYPE] (One of them): vk, fb, ok, gp\
\[DOMAIN] ex: clicklogin.ru\
\[REDIRECT\_URL] ex: <https://clicklogin.ru/\\>
\* You can take token from first request in this document.\
\* After this link user will be redirected to Social Network, and bring back to your Redirect URL with ?token\_auth param, then you need to check it via CheckUser request below.<br>

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

```
```

{% endtab %}
{% endtabs %}

## Check user Auth

<mark style="color:blue;">`GET`</mark> `https://api.clicklogin.ru/api/usereq?token=[TOKEN_AUTH]`

You can use file\_get\_contents() on this link with TOKEN\_AUTH from previous request.

#### Path Parameters

| Name  | Type   | Description                       |
| ----- | ------ | --------------------------------- |
| token | string | TOKEN\_AUTH from previous request |

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

```
{
    "error": false,
    "message": "User data successfully requested",
    "data": {
        "user": {
            ...
            user_id
            email
            first_name
            last_name
        }
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "error": true,
    "message": "Wrong user",
    "data": []
}
```

{% endtab %}
{% endtabs %}
