---
title: "How to Get Your AdsGram BlockId"
description: "Step-by-step guide to creating an ad platform and ad unit in AdsGram to get the blockId needed to integrate ads into your mini app."
outline: [3, 4]
---
# How to create BlockId?
___
### Sign up
Create your account on https://partner.adsgram.ai/registration

![Registration](../images/registration.webp =300x){zoom-forbidden}

::: warning
If you have already connected to our network as an advertiser and launched campaigns, it is important to authorize in the [publisher's account](https://partner.adsgram.ai) under the same login that you used to register in the [advertiser's account](https://traffic.adsgram.ai).\
So we automatically won't show ad that lead to your app inside your app.
:::
___

### Create `Ad Platform`{#create-ad-platform}
Click `Create platform` and choose `Telegram Mini-app`.

![Create platform](./images/create_platform.webp){zoom-forbidden}

**App name** — convenient for you name of your App.\
**Telegram direct link** — direct link to your telegram app.\
**Web app url** — the url of your application where it's hosted.
::: info
App owner can get **Telegram direct link** and **Web app url**  in [BotFather](https://t.me/BotFather) using command `/myapps`.

![Get Telegram direct link and Web app url](./images/botfather_myapps.webp){zoom-forbidden}
:::

##### **Bot ID** — unique identifier for your bot on telegram.
::: info
App owner can get **Bot ID** in [BotFather](https://t.me/BotFather) using command `/mybots` and click on **API Token** button. 

![Get bot info](./images/botfather_mybots.webp){zoom-forbidden}

The first part of API Token before colon is the **Bot ID**. 

![Get bot id](./images/botfather_bot_id.webp){zoom-forbidden}
:::

#### Create Test platform
If you want to test in the dev/test version of your app for debugging ad setup and integration, create a **Test platform**.\
After creation, the platform can be launched with a status <Badge type="tip">Active</Badge> without undergoing moderation. Events related to test platforms will not be counted.

::: warning
When creating a Test platform, use **Telegram direct link**, **Web app url**, **Bot ID** of your dev app, otherwise you will get an error like this 👇

![Wrong referrer error](./images/wrong_referrer_error.webp =500x){zoom-forbidden}
:::

#### Banning the display of niche verticals for adult audience and Gambling 
By contacting our support [@adsgram_supportbot](https://t.me/adsgram_supportbot) or [support@adsgram.ai](mailto:support@adsgram.ai), you can ask to turn off the impressions of advertisers from the Gambling or Adult categories on your mini app.
::: danger
Disabling them will lead to a significant decrease in your income.
:::
___
### Create `Ad unit`{#create-ad-unit}
Open the created platform and click `+ Block` in the **Ad blocks** section.

![Create block](./images/create_block.webp)
**Name** — the name of the block is convenient for you.\
**Ad Platform** — the platform you opened is selected automatically. You can choose another one in the dropdown menu.\
**Block type** — the type of the block you want to show. Choose block type in dropdown menu. Can be [Reward](./reward-examples), [Interstitial](./interstitial-examples) or [Task](./task-examples)

#### **Reward URL** <Badge type="info" text="Optional" />
It makes sense for publishers who have more than 50k daily average users.\
It's used in addition to the standard client-side callback that is used in [show](./api-reference.md#show) function, after user gets reward on client side, we send GET request with user `telegramId` to your reward url.
To connect the server confirmation of the reward for the user, your endpoint must meet the following conditions:
- Accepts GET request.
- This is https request, that means port will be 443.
- Has [userId] part, the [userId] part of the string will be replaced with the Telegram ID of the user.
Example: `https://test.adsgram.ai/reward?userid=[userId]`
::: warning
In [debug mode](./api-reference.md#parameters) request won't be sent as debug view does not count as real ad view.
:::

::: tip
If you display ads in several places inside the web app. For a better understanding of where users watch ads and you earn, it is convenient to use several blocks. Statistics for each block will be displayed separately on the platform page.\
Up to 10 ad units can be created for one ad platform.

![Blocks](./images/blocks.webp)
:::

### Moderation
After the block is created, it must go through [moderation](./moderation). To submit the platform and ad block for moderation, click the `Start` button.
___
### Copy BlockID
In the right top corner click `<> Show code` and then `Copy BlockID`. Use this blockId in your code.
