Getting started

1

Get your API token

First, you’ll need an API token. Open the Telegram bot and send the /api command. You’ll get your token right away.

If you already have a token but forgot it, just click the “Show token” button to see it again.

Open the bot

2

Install the library

We have libraries for Python, TypeScript, and PHP that make integration much easier. Install the one you need:

$pip install kokos_activator_api

You can use the HTTP API directly if you prefer, but the libraries will save you a lot of time.

3

Create an API client

Once you’ve installed the library, create a client like this:

1from kokos_activator_api import AsyncKokosApi
2from kokos_activator_api.environment import KokosApiEnvironment
3
4client = AsyncKokosApi(
5 token="YOUR_TOKEN",
6 environment=KokosApiEnvironment.PRODUCTION,
7)
4

Make your first request

Let’s test the connection with the “Get Inventory” method. This shows how many codes are available for each pack size.

1print(await client.database.get_inventory())

You should see a response like this:

Response
1{
2 "60": 18,
3 "325": 0,
4 "660": 0,
5 "1800": 2,
6 "3850": 0,
7 "8100": 1
8}

Great! You’re now connected to the API.

Next steps

Now that you’re connected, you can start redeeming codes.