Skip to content

Before you start#

Before you start working with the Telegram messenger, you need to:

  1. Install the Telegram mobile application
  2. Register in the Green-API console
  3. Create and authorize an instance
  4. Get the instance access parameters
  5. Set up receiving incoming data
  6. Read about the differences of the Telegram version

1. Installing the Telegram mobile application#

Sending and receiving Telegram messenger messages is performed from an already existing account.

  1. Install the official mobile application:

  2. Open the application and tap Log in

  3. Enter your phone number, a code will be sent to you to confirm the login
  4. The confirmation code will be sent to the Telegram application (if you are already authorized on another device) or by SMS.

After registering in the mobile application, you will be able to use all of its features - send and receive messages, make calls, etc.


2. Registration in the console#

To use the service, go to the console and register. The registration procedure:

  1. Enter your email

    We recommend using a corporate email to prevent losing access to the account when an employee leaves

  2. Select a country

  3. Accept the user agreement and click the Sign up button
  4. An email will be sent to the specified email address. Enter the code from the email to confirm your account

    In addition to the general inbox, we recommend checking the Spam folder, as the email may end up there

    register
    code


3. Creating and authorizing an instance#

What an instance is#

An instance is a unique gateway number for sending and receiving messages through the Telegram messenger.

It is the link between your messenger account and the API for sending requests and receiving notifications.

An instance is created in the console and is used to organize the Telegram messenger HTTP API.

Important

One instance can serve only one Telegram account (one phone number) at a time.
To connect several accounts, you need to create a separate instance for each Telegram account (each instance is billed separately)


Creating an instance#

The procedure for creating an instance:

  1. In the console, click the Create an instance button
  2. Select a plan
  3. If the plan requires payment, select a payment method and confirm the payment
  4. Go to the list of instances by clicking the Instances button in the side menu. In the list you can see the instance you created

    It may take up to 2 minutes for the instance to become operational after creation

    create


Instance authorization#

To work with GREEN-API, you need to authorize an instance.
Authorization is performed in the console in one of two ways:

  1. Open the Telegram application on your mobile device
  2. Open the menu ⚙ Settings🖳 DevicesLink Desktop Device
  3. In the console, select the required instance
  4. Click the Get QR button and scan the code in the mobile application

QR

  1. Use the StartAuthorization method to get an authorization code

    The code will arrive in the messenger service chat or by SMS

    code

  2. Send the received code using the SendAuthorizationCode method

    If your account is protected by a password, also specify it in the password field

    If you sent SendAuthorizationCode with the code but without the password, you can send it separately using the SendAuthorizationPassword method

We recommend performing authorization by the QR method


4. Get the instance access parameters#

To execute Telegram messenger HTTP API requests, you need to use the instance access parameters. The access parameters are published in the console:

  • apiUrl - link to the API host
  • mediaUrl - link to the API host for sending files
  • idInstance - unique instance number
  • apiTokenInstance - instance access key

    parameters

The instance access key can be changed if necessary, for example, if it has been compromised. You can change the token in the console yourself or by contacting technical support.


5. Set up receiving incoming data#

If you need to receive incoming data (incoming messages, statuses of previously sent messages, etc.), you first need to configure the instance.


6. Key differences of the Telegram version#

The Telegram version is developed on the basis of the current version of GREEN-API.

The architecture and logic of interaction with the API remain the same, however there are a number of differences due to how the Telegram messenger works.
You can read about the specifics of this version in the article Key differences of the Telegram version.


Done!#

Everything is ready to start sending and receiving messages through the Telegram messenger!