# Twitter

## Set up

To set up your assistant's Twitter integration, you'll need the following:

* A Twitter account linked to a phone number.

### Create a Twitter app

1. Access the [Twitter developer console](https://developer.twitter.com).
2. Click 'Sign Up' to register as a developer. Enter the information requested.
3. Then access the project created in the **Projects & Apps** section, by default it will be created with the name 'Project 1'.
4. In the **Apps** module click on the 'App settings' button.\
   ![](/files/15MV2pqRUWglYJRc2ivd)
5. Configure the authentication option in the section **User authentication settings**.\
   ![](https://lh3.googleusercontent.com/r67AagfxgUgkOjOeZoulgAZqnaWAsbnrr1-SXG74ZV-nGEGgaDOFZlJtco2Lrhsqr4vF1GwPSPPgGeQXafvaNHz57ZcCSwKuJ_1A2oPHtsgvwj-bbIvjPsbf3EcgZ5y9Czl1_lKMJNan18VDL_V-tA)
6. Activate Oauth 1.0a and select 'Read and write Direct Message'.
7. Copy the URL that you will find in the integration options and paste it in 'Callback URI/Redirect URL'.\
   ![](/files/q4gqHLVhbAjObnjL1ZJx)
8. Enter your website and save the changes.\
   ![](/files/YHQZmgCDpe0rGtKunTLT)
9. Go back to the project created in the **Projects & Apps** section and in the **Apps** section click on the 'Keys & tokens' button.\
   ![](/files/O37Uwq7IiIlgxOFJl5ZZ)
10. Generates the 'Api Key and Secret' and 'Access Token and Secret' tokens. Copy each of them to use later in the integration.\
    ![](/files/tY0MsdP3qzOoHVghgJyO)

### Set permissions

You need to request higher permissions to set up a development environment.

1. Access the main page of the project and click on 'Apply' that appears after the question 'Do you need Elevated access for your Project?'.\
   ![](/files/0etquS2vKkFe5k2tV74r)
2. The form will ask you for a detailed description (200 characters) of what the API will be used for. For example:\
   "*The access to the API will be used to activate the webhook that connects a chatbot with the direct messages of the Twitter account. When a user sends a question as a direct message, they will receive an automatic response that resolves their question."*
3. In the form, activate the option of the question 'Will your App use Tweet, Retweet, Like, Follow or Direct Message functionality?' and describes: "When a user sends a question as a direct message, they will receive an automatic response that resolves their question."
4. Submit the request.
5. After approval, go to the **Products** > **Premium** > **Dev Environments** menu section.
6. Enable the 'Account Activity API' option.
7. Enter a name in the 'Dev environment label' (copy this name for later use in the integration) and link it to the App you initially created.

{% hint style="info" %}
**Importante:** Your application may be automatically approved or you may have to wait for a while.
{% endhint %}

### Activate integration

1. In the Twitter integration module, enter all the data that you previously copied.\
   ![](/files/ZAwzDVU33va9cLny4cup)
2. Save the settings.
3. Done!:tada: Run tests to verify the operation of your assistant on Twitter.

## Limitations

* Maximum 1000 messages per day.&#x20;
* Each message received from a user can have a maximum of 5 responses from the bot (Upon receiving another new message from the user, another 5 messages can be sent).&#x20;
* The maximum characters per message is 10,000.&#x20;
* Maximum 20 text buttons in each message.&#x20;
* The maximum number of characters for the button text is 36.


---

# 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/twitter.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.
