---
title: Twitter V2+V1 Post With Media
slug: bubble/Twitter-v2-oauth-post-with-media
docTags: 
createdAt: 2023-08-03T12:27:30.623Z
---

Twitter has deprecated the ability to post using the V1 API. Twitter's V2 API endpoint does allow for you to post a Tweet. However, the endpoint available only offers the ability to Post, they do not have an endpoint for posting **with media**.&#x20;

The team at Pathfix has found a **temporary&#x20;**&#x77;orkaround by using a combination of the V1 and V2 endpoint.



How this works?

- Use the V1 endpoint to prepare the media for upload
- Use the V2 endpoint to post the Tweet with media

Note: This is a temporary workaround until Twitter releases the ability to prepare and post Tweet with Media



## Setup

You will need to configure and add both, Twitter and Twitter V2 integration in your Pathfix account. This means, your users will have to connect to both Twitter V1 **and&#x20;**&#x56;2 in your app to give them the ability to post with media.



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/32fAfTpAgqtE9-C46gdfj_image.png" size="84" width="1209" height="400" position="center" showCaption="false"}

### Setup in Twitter Dev

- Create your Twitter Developer account here: [https://developer.twitter.com/en/portal](https://developer.twitter.com/en/portal)
- If you have an existing account with Twitter developer, make sure you only have the total number of approved projects based on your plan



**Twitter API known issues**

Due to the ongoing migration from V1 to V2, there are a few known configuration/app issues that our team and users have seen, these are:

- Twitter is deleting/removing access and blocking API requests for entire accounts that have more than the allowed number of apps. Please check your limits in your account and delete any extra apps



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/JUrdswTPKw3Xx1jgEiuSg_image.png" size="88" width="2216" height="1246" position="center" showCaption="false"}

- Some users are facing issue of Twitter randomly deleting their app everyday. Adding the app once again resolves this. For more information read the [forum discussion here](https://twittercommunity.com/t/twitter-keeps-removing-our-app-from-our-project/197274/16) &#x20;



**Setup**

- Click on the **Keys and Tokens** tab
- Copy the **Consume Keys** for use with Twitter V1 configuration
- Copy the **OAuth 2.0 Keys** for use in Twitter V2 configuration



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/VioLm3cSiDSiK2xO6gvf7_image.png" size="78" width="1095" height="1107" position="center" showCaption="false"}



### Setup in Pathfix

- Log into Pathfix and add an **Application&#x20;**(or select an existing application)
- Select Twitter from the list of providers
- Add the Consumer Keys copied over from your Twitter dev portal&#x20;
- **Save&#x20;**&#x74;he settings
- Click on **Test Connection** and connect an account to test the configuration



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/CFVZWV62-XjuWRKbCKWEf_image.png" size="80" width="1167" height="793" position="center" showCaption="false"}



- Go back to the **Application&#x20;**&#x70;age&#x20;
- Select Twitter V2  from the list of providers
- Add your Twitter V2 OAuth 2.0 *ClientID* and *ClientSecret* and hit **Save**
- Click on **Test Connection** and connect an account to test the configuration



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/Zp-8NoPjIvmkMrcrFEcVr_image.png" size="80" width="1156" height="1025" position="center" showCaption="false"}



### Setup in Bubble

You will need to install 3 plugins for the setup to work:

1. [Pathfix OAuth Connector](https://docs.pathfix.com/bubble/pathfix-oauth-connector)
2. [Twitter V1 Plugin](https://docs.pathfix.com/bubble/twitter-integration)
3. [Twitter V2 Plugin ](https://docs.pathfix.com/bubble/twitter-v2-integration)(version 2.2.1)



Install all 3 plugins and add the Public Key and x-partner-key to the Pathfix plugins before proceeding.&#x20;



- In the Design page, add the **Pathfix Connector** element to the page&#x20;
- In the setup/properties window, select '**All Providers in my Pathfix account**' and add the following list of providers: **twitteroauth2,twitter**
- This will show the Twitter V1 and Twitter V2 connect buttons



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/vIIfxcJXvQjT9XrWAe6me_image.png" size="80" width="1303" height="902" position="center" showCaption="false"}



- Add an Input element to capture Text input from your user
- Add a Picture uploader element to capture images from the user
- Add a Button element to allow for the post action



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/Ez-__IGxssEBF-_n-sVSm_image.png" size="80" width="970" height="352" position="center" showCaption="false"}



**Setting Up The Workflow**

This is a 4 step process as Twitter needs certain info and file format, here is the sample setup.&#x20;



**Step 1:&#x20;**

- Select to include the file size and file type with the call



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/Krw-oFyjAf4zOlRgGWnBx_image.png" size="80" width="1287" height="837" position="center" showCaption="false"}



**Step 2:**

- Select the media ID String and Base 64 encoding



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/tKsXa6fIJ7GVvRIfb9akN_image.png" size="80" width="1101" height="688" position="center" showCaption="false"}



**Step 3:**

- Finalize the media and select the Media ID String&#x20;



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/E9xj4WtuMGoqdOvkHJ6ND_image.png" size="80" width="1112" height="624" position="center" showCaption="false"}



**Step 4:**

- Post the Tweet with media and Message using the Twitter V2 API for Post Media with Tweet



::Image[]{src="https://api.archbee.com/api/optimize/E6H_--BmYJWG_yGaOUOxt/gDVn0T-okSAE6jorZE9Ko_image.png" size="80" width="1283" height="655" position="center" showCaption="false"}



Your setup is complete.

Go to the Preview of your app, connect your Twitter account to both Twitter V1 and V2, test the post with media functionality.&#x20;





Need help? Reach out to us at support\@pathfix.com



