> For the complete documentation index, see [llms.txt](https://wiki.bot-ads.ovh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.bot-ads.ovh/earn/getting-started/code-system.md).

# Code System

System to detect whether or not someone has clicked on your link

#### `STEP 1` - Generate a unique code to identify a user

To be able to detect whether a link is clicked or not by a user, you need to generate one yourself.

For example, you can enter the user's ID/email address, or generate a code and link it to the utility in your database !

{% hint style="info" %}
Code can be text or integers.\
\
**Codes are deleted from our database&#x20;**<mark style="color:yellow;">**1 day after registration**</mark>**.**
{% endhint %}

#### `STEP 2` - Generate advertising&#x20;

All you need to do is add the `click_code` option to our basic query:c

```
https://bot-ads.ovh/api/system/getlink?bot_id={YOUR_ID}&click_code={YOUR_UNIQUE_CODE}
```

*The bot will return the same data as for the classic query*

#### `STEP 3` - Check click&#x20;

To check whether the code has been clicked, perform the following query:

```
https://bot-ads.ovh/api/public/checkcode?code={YOUR_UNIQUE_CODE}&bot_id={YOUR_ID}
```

Here are the possible api responses:

| code | success | clicked | message                                            |
| ---- | ------- | ------- | -------------------------------------------------- |
| 200  | true    | true    | Code found                                         |
| 200  | true    | false   | Code not found                                     |
| 400  | false   |         | Missing data. Be sure to provide code and bot\_id. |
| 500  | false   |         | Internal error.                                    |
