# Set up Telegram account masking

This article will show you how to use three pre-made flows to set up Account Masking in Telegram.

&#x20;

### Requirements

* A [MessageBird account](https://dashboard.messagebird.com/en/sign-up)
* [Telegram account and bot](https://developers.messagebird.com/docs/conversations/install-channel-telegram/)
* [Flow Builder](https://dashboard.messagebird.com/en/flow-builder)

&#x20;

### Step one: Set up MessageBird and your Telegram bot

Before you can set up the pre-made flows, you'll need to make sure you have a MessageBird account and a Telegram bot Follow these steps to get set up:

1. Sign up for a [MessageBird account](https://dashboard.messagebird.com/en/sign-up)
2. Create a [Telegram bot](https://developers.messagebird.com/docs/conversations/install-channel-telegram/) and [install it as a channel](https://www.youtube.com/watch?v=nymZB_6iKUc) in your MessageBird Dashboard

&#x20;

### Step two: Set up the customer-to-business flow

1. Download the pre-made [TGAM - C2B flow](https://drive.google.com/file/d/1uPzYaFtf3S76GtSTaMmavGbqZhCwa-mV/view)
2. Log in to your [MessageBird Dashboard](https://dashboard.messagebird.com/)
3. Navigate to [Flow Builder](https://dashboard.messagebird.com/en/flow-builder)
4. Click on **Import flow** and import your TGAM - C2B flow
5. Go to the Webhook step and **copy** the Webhook URL (make a note of it)<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-a5a76b5f1c27b5583d21505c0e317e578cd9a7cc%2FScreen_Shot_2020-04-02_at_10.06.33_pm.png?alt=media" alt=""><figcaption></figcaption></figure>
6. Go to the step called **Your TGAM 1 of 3** and select your Telegram channel from the menu<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-2e0219ea38989655ef4580b00d8f4dde80c03059%2Funnamed__1_.png?alt=media" alt=""><figcaption></figcaption></figure>
7. **Save** the step
8. **Publish** your flow

&#x20;

### Step three: Set up the business-to-business flow

1. Download the pre-made [TGAM - B2B flow](https://drive.google.com/file/d/1zzIavsY7vCUT1qSbi3_otEzOb96VNFxM/view?usp=sharing)
2. Navigate to [Flow Builder](https://dashboard.messagebird.com/en/flow-builder)
3. Click on **Import flow** and import your TGAM - B2B flow
4. Go to the Webhook step and **copy** the Webhook URL (make a note of it)<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-a5a76b5f1c27b5583d21505c0e317e578cd9a7cc%2FScreen_Shot_2020-04-02_at_10.06.33_pm.png?alt=media" alt=""><figcaption></figcaption></figure>
5. Go to the step called **Your TGAM 1 of 3** and select your Telegram channel from the menu
6. **Save** the step
7. **Publish** your flow

&#x20;

### Step four: Set up the engage flow

1. Download the pre-made [TGAM - Engage flow](https://drive.google.com/file/d/1e1sz0u2nmc09V3bvWwCM-PJndPATqKa0/view?usp=sharing)
2. Navigate to [Flow Builder](https://dashboard.messagebird.com/en/flow-builder)
3. Click on **Import flow** and import your TGAM - Engage flow
4. Go to the **Omni-channel step** and select your Telegram channel from the menu<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-f03358c3c60a36ff0a83da3be1baf57da2ec4ba0%2Funnamed__2_.png?alt=media" alt=""><figcaption></figcaption></figure>
5. Go to the **Webhook URL of TGAM - B2C** step and replace the URL with the TGAM B2C URL you copied in step one. **Save** the step<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-ff9bbbd74cd0fdd16fe616cc8cf83f8bd5f35238%2Funnamed__3_.png?alt=media" alt=""><figcaption></figcaption></figure>
6. Go to the **Webhook URL of TGAM - B2B** step and replace the URL with the TGAM B2B URL you copied in step two. **Save** the step
7. Because the customer will start the conversation, the customer Telegram ID can be retrieved via our conversation API. Go to the **Fetch customer telegram ID** step and add your MessageBird access key in the Authorization header<br>

   <figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-59e56bbf2df81156ff6fb144ee099de89e545405%2FScreenshot_2020-08-24_at_09.30.07.png?alt=media" alt=""><figcaption></figcaption></figure>
8. Go to the **Set variables** step. This flow is set up to fetch the driver **TelegramID**, which it is assumed you have collected and stored at a previous stage, such as during the driver onboarding. For demonstration purposes, just add your **TelegramID**, which you can fetch using our conversation API. **Save** the step
9. **Publish** your flow

&#x20;

### Step five: Test your Telegram Account Masking bot

1. Add your Telegram bot username to the following deep link<br>

   <pre><code><strong>https://t.me/&#x3C;bot username>
   </strong></code></pre>
2. Send the link to your **conversation buddy** (someone who can help you test the flow)
3. Your buddy must reply with the following, which will trigger the Telegram Account Masking bot&#x20;

   ```
   #tgam
   ```
4. You will receive their message. Respond to start the masked conversation!
