# Instagram Messenger

## Set up

To set up your assistant integration in Instagram Messenger, you will need the following:

* A Facebook account registered in the [developer console](https://developers.facebook.com/).
* A Facebook page connected to Meta Business.
* An Instagram account connected to Meta Business.

### Create a Meta app

1. Access the [Facebook developer console](https://developers.facebook.com/).
2. Click on 'Create application', select 'Other', and then click on 'Continue'.\
   ![](/files/e1siyE5ycXJScl7XSut5)
3. Select 'Business' in the next step.\
   ![](/files/toqZlf2WKBrTJgW3cDDK)
4. In the form, fill in all fields and click on 'Create application'.\
   ![](/files/XMpdX69SUMmuXEtzeTpd)
5. In the **Dashboard** menu section, click 'Configure' for the Instagram product.\
   ![](/files/KogozhjP4gSGpj4jWehg)

### Generate a Permanent Access Token

1. Go to **Instagram** > **Setting up the API with Instagram login**.
2. In the first step, click on 'Add Account'.\
   ![](/files/sR41wbkXsicsJtlQWHcW)
3. Log in with the Instagram account you want to connect to the assistant.\\
4. Save and click on 'Generate Token'.\
   ![](/files/pqTlJgTXNHI0qIG15JqN)
5. Copy the generated token for future use. ![](/files/Y9CgcCgT3HtZracc5wOB)

### Obtain the Instagram Page ID

1. Go to **Instagram** > **Setting up the API with Instagram login**.
2. Copy the Page ID displayed below the Instagram account.\
   ![](/files/pqTlJgTXNHI0qIG15JqN)

### Obtain the application secret key

1. Go to **Instagram** > **Setting up the API with Instagram login**.
2. In the third step, click on 'Configure' and add the URL of your website and save.
3. Again, click on 'Configure business login' and copy the Instagram application secret key.\
   ![](/files/3txbHXcGVmQzEx81AO5J)

### Connect your app with your assistant

#### Activate integration in 1millionbot platform

1. Go to the **Channels** section on the platform.
2. Activate Instagram and click on 'Settings'.
3. Enter the previously obtained data: Application Secret Key, Permanent Access Token and Instagram Page ID
4. Click on 'Save'.\
   ![](/files/ZJpJ2dQQZBunysTdY5XU)

#### Activate integration in Meta

**Obtain the Callback URL**

1. Go to the 1millionbot platform and click on the 'Info' button in the Instagram channel to get the callback URL.\
   ![](/files/wgYuxs2waYGfmftKbN4O)

**Configure the Meta Webhook**

1. In the **Instagram** > **Setting up the API with Instagram login** menu section, click on 'Edit' or 'Add' in the **Webhook** section (second step).\
   ![](/files/sR41wbkXsicsJtlQWHcW)
2. Paste the previously obtained callback URL and Permanent Access Token.
3. Click on 'Save'.

### Set permissions

1. In the previous section, click on 'Administrate'.
2. Subscribe to messages permissions.\
   ![](/files/sXKcCOyZa8cLtRwlC8JT)

### Publish Meta app

1. Now, your application is in development mode, so you can test the assistant's operation as long as you are the owner or have access to the Instagram account connected to the assistant.
2. To publish the assistant for public interaction, complete the last step. ![](/files/xxmeCMTKnoD3WGGtEVK5)
3. Done! Once published, perform tests to verify the operation of your assistant on the provided Instagram account. 🎉

## Limitations

* A maximum of (200 \* Number of Followers) messages can be sent per day per bot.
* Buttons must have a maximum of 20 characters.
* Maximum of 3 buttons per message.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.1millionbot.com/chatbot/channels/instagram-messenger.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
