Skip to content

Before you start#

Beta version

The functionality is in beta. Features may change and may also work unstably.

Before you start working with Instagram you are required to follow the below steps:

  1. Prepare the Instagram account
  2. Registration in the console
  3. Create and authorize an instance
  4. Get access parameters to instance
  5. Set receiving incoming data
  6. Important differences

1. Prepare the Instagram account#

The work is performed on behalf of a regular Instagram account - the same one you use in the app or on the website.

  1. Make sure that the account is registered and confirmed: you can log in with a login and password at instagram.com or in the official mobile app:

  2. Check that the account has no pending Instagram requirements: login confirmation, password change, acceptance of new terms. While such a requirement is pending, the instance cannot be authorized.

  3. If two-factor authentication is enabled on the account, prepare access to the source of the code - an authenticator app, SMS or backup codes. The code is required once, during instance authorization.

    Two-factor authentication does not interfere with the work

    There is no need to disable two-factor authentication (2FA). The code is requested only at the authorization stage, and it is confirmed with the SendAuthorizationCode method.

2. Registration in the console#

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

  1. Enter your email address

    We recommend using a corporate email to prevent the loss of account access in case an employee leaves

  2. Select your country

  3. After accepting the user agreement, click on the Register button
  4. An email will be sent to your email address. Enter the code provided in the email to confirm your account

    We recommend checking the Spam folder in addition to the general incoming messages, as the letter may end up there

register
code

3. Create and authorize an instance#

Instance creation#

An instance is a unique gateway number for sending and receiving messages through Instagram.

Instances are created in the console and are used for organizing the Instagram HTTP API.

One instance can simultaneously serve only one Instagram account.
You can create an unlimited number of instances under a single GREEN-API console account (each instance is billed separately)

Steps to create an instance:

  1. In the console, click on the Create an instance button
  2. Choose a plan
  3. If required, select a payment method and make the payment
  4. Go to the list of instances by clicking on Instances in the side menu. You will see the instance you created in the list

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

create


Instance authorization#

To work with the GREEN-API, you need to authorize your instance.
The authorization is performed in one of two ways:

Authorization with a login and password#

  1. Call the Login method and pass the login of the account (the username, phone number or email) and the password
  2. Check the value of the type field in the method response. It shows the authorization result or that additional actions are required:

    • authorized - the instance is authorized, no further actions are required
    • confirmFromDevice - tap "Yes" in the Instagram app on a device where the account is already open, and repeat the login request with the same data
    • twoFactorRequired - pass the two-factor authentication confirmation code with the SendAuthorizationCode method

    The other type values are described on the Login method page

Authorization through a browser session#

  1. Log in to the Instagram account through a browser at instagram.com
  2. Collect the browser session data with the green-api-connector extension

The order of the steps is described in the How to authorize an instance through a browser extension article

With this way of authorization, some API methods are unavailable or work with limitations

4. Get access parameters to instance#

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

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

parameters

Instance access key can be changed if necessary, for example, if it is compromised. You can change the token in the console yourself or contact tech support.

5. Set receiving incoming data#

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

Incoming notifications are received by one of the following technologies:

6. Important differences#

The architecture and the logic of interaction with the API are the same as for the other GREEN-API messengers, however there are a number of differences due to the way Instagram works.
The integration specifics are described in the Important differences article.

Done!#

Everything is ready to start working with Instagram chats, posts and comments!