# Session

> <mark style="color:red;">PREMIUM ENDPOINT</mark>

## Fetch the information about a session\_key

<mark style="color:blue;">`GET`</mark> `https://kitkot.xyz/api/session`

Fetch a tiktok session by a `session_key` returned from our login endpoint

#### Query Parameters

| Name                                           | Type   | Description                                       |
| ---------------------------------------------- | ------ | ------------------------------------------------- |
| api\_key<mark style="color:red;">\*</mark>     | String | The `api_key` you got when purchasing our service |
| session\_key<mark style="color:red;">\*</mark> | String | The `session_key` returned by our server          |

{% tabs %}
{% tab title="200: OK LOGIN\_SUCCESSFUL" %}
{% code lineNumbers="true" %}

```json
{
  code: 200,
  msg: 'success',
  region: '',
  email: '',
  screen_name: '',
  phone: '',
  is_verified: false,
  user_id: '',
  sec_user_id: '',
  profile_picture: '',
  session_key: '',
  need_device_create: {
    code: 0,
    msg: ''
  },
  is_new_user: 0,
  cloud_token: '',
  connects: []
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request TOO\_MANY\_ATTEMPTS" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 400,
    'msg': 'Too many attempts, try again later'
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request FAILED\_LOGIN\_2STEP" %}
{% code lineNumbers="true" %}

```json
{
    'code': 400, 
    'msg': 'Failed to login, make sure you do not have 2step authentication activated.'
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found INCORRECT\_USERNAME\_PASSWORD" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 404,
    'msg': 'Incorrect username/password'
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found INCORRECT\_EMAIL" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 404, 
    'msg': 'Incorrect email'
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request FAILED\_LOGIN\_0" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    code: 400,
    msg: 'Failed to login (0)'
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request FAILED\_LOGIN\_1" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    code: 400,
    msg: 'Failed to login (1)'
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found INCORRECT\_PASSWORD" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 404,
    'msg': 'Incorrect password'
}
```

{% endcode %}
{% endtab %}

{% tab title="500: Internal Server Error PROXY\_FAILURE" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    code: 500,
    msg: "Proxy Failure"
}
```

{% endcode %}
{% endtab %}

{% tab title="500: Internal Server Error SERVER\_ERROR" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 500,
    'msg': 'Server error, contact us if this happens repeatedly (0)'
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request TIKTOK\_SERVER\_ERROR" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 400,
    'msg': 'TikTok server error'
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request ADDITIONAL\_VERIFICATION\_REQUIRED" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 400,
    'msg': 'This account requires additional verification to login to'
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request 2STEP\_VERIFICATION\_REQUIRED" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
{
    'code': 400,
    'msg': 'This account has 2step verification enabled'
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="NodeJS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
const fetch = require('node-fetch');

const BASEURL = "https://kitkot.xyz/api";
const API_KEY = "my-api-key";
const SESSION_KEY = "my-session-key";

const request = await fetch(`${BASEURL}/session?api_key=${API_KEY}&session_key=${SESSION_KEY}`);
const response = await request.json();
console.log(response);
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}

```python
import requests

BASEURL = "https://kitkot.xyz/api"
API_KEY = "my-api-key"
session_key = "my-session-key"

request = requests.get(f"{BASEURL}/session?api_key={API_KEY}&session_key={session_key}")
response = request.json()
print(response)
```

{% endtab %}
{% endtabs %}
