# Twitter

Twitter is a social media platform that allows users to share short messages called tweets, engage with others through replies, retweets, and likes, and follow trending topics worldwide. It is widely used for real-time news updates, social networking, and brand engagement. Users can follow accounts, participate in trending discussions, and share multimedia content.

### **How to Integrate Twitter with ZBrain Flow** <a href="#how-to-integrate-twitter-with-zbrain-flow" id="how-to-integrate-twitter-with-zbrain-flow"></a>

Follow these steps to set up the integration:

1. **Open ZBrain Flow** – Navigate to the ZBrain Flow platform.
2. **Click the ‘+’ Button** – Initiate a new integration setup.
3. **Search for Twitter** – Type "Twitter" in the search bar.
4. **Choose an Action** – Select the specific action, such as posting a tweet or replying to one.

### **How to Connect Twitter with ZBrain Flow** <a href="#how-to-connect-twitter-with-zbrain-flow" id="how-to-connect-twitter-with-zbrain-flow"></a>

To establish a secure connection between Twitter and ZBrain Flow, follow these steps:

1. **Provide a Connection Name** – Assign a recognizable name to identify your Twitter connection.
2. **Enter API Credentials** – Input the following required credentials:
   * API Key
   * API Key Secret
   * Access Token
   * Access Token Secret
3. **Click ‘Save’** – Finalize and authenticate the connection.

#### **How to Get Twitter API Credentials** <a href="#how-to-get-twitter-api-credentials" id="how-to-get-twitter-api-credentials"></a>

To access Twitter's API, follow these steps:

**Step 1: Create a Twitter Developer Account**

* Visit the [Twitter Developer Portal](https://developer.twitter.com/) and log in with your Twitter credentials.
* If you don’t have a developer account, apply for one by providing details about your intended API usage.

**Step 2: Create a New Twitter App**

* Navigate to the Projects & Apps section and click Create App.
* Enter the required details:
  * **App Name** – Choose a unique name for your application.
  * **Description** – Provide a brief explanation of how you’ll use Twitter’s API.
  * **Website URL** – Enter a valid website link (this can be a placeholder if not applicable).

**Step 3: Generate API Credentials**

1. **Obtain API Key and API Key Secret:**
   * Go to your app’s Keys and Tokens section.
   * Copy the API Key (consumer key) and API Key Secret (consumer secret).
2. **Generate Access Token and Access Token Secret:**
   * Scroll down to the Authentication Tokens section.
   * Click ‘Generate’ to create your Access Token and Access Token Secret.

### **Available Actions in Twitter Integration** <a href="#available-actions-in-twitter-integration" id="available-actions-in-twitter-integration"></a>

#### **1. Create Tweet** <a href="#id-1.-create-tweet" id="id-1.-create-tweet"></a>

This action allows you to post a new tweet from your account.

**Steps:**

* Select an existing Twitter connection or create a new one.
* Enter the text for the tweet (up to 280 characters).
* Optionally, attach media files (images, videos, or GIFs) by providing URLs or base64-encoded data. You can attach up to three media files per tweet.

#### **2. Create Reply** <a href="#id-2.-create-reply" id="id-2.-create-reply"></a>

This action enables you to reply to an existing tweet using your connected Twitter account.

**Steps:**

* Select an existing Twitter connection or create a new one.
* Enter the Tweet ID of the post you want to reply to.
* Enter the reply text (up to 280 characters).
* Optionally, attach media files (images, videos, or GIFs) by providing URLs or base64-encoded data (up to three media files).


---

# 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.zbrain.ai/zbrain-documentation/zbrain-builder/flows/flow-components/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.
