As I have detailed previously:
Power Automate Twitter connector failing
I needed to regenerate the connection to Twitter in my Flows. The following is what worked for me and I hope it can help you as I didn’t find this set out clearly anywhere else. I found that you needed to create all new Twitter connections in your Flows, so remember to record how these are configured before you go and delete anything.
Step 1. Remove any existing Twitter connections in your Data
Navigate to Power Automate and select Data and then Connections from the menu on the left. In the top right of this screen you will find a Search box. Into this search box type:
You should now see a list of all your existing Twitter connections. ALL of these will need to be removed and thus prior, ensure you have recorded what your Twitter actions do in your Flows, because once you delete the connection here you will NOT be able to see what the actions actually did. They will simply show as invalid.
The reason you need to delete ALL the Twitter connections you find is the above error:
Failed to create connection for connection id ‘/providers/MicrosoftPowerApps/apps/shared_twitter/connections/shared-twitter-<guid>’. You have reached the maximum number of connections for the ‘twitter’ API.
I personally found I actually had two connectors. Both years apart, but all must be removed as Twitter now only supports one connection for free.
Step 2. Create Twitter API credentials
Microsoft does provide documentation on this here:
Authentication and Bring your own application
and to start with ensure you are logged into your Twitter account in the browser and navigate to:
https://developer.twitter.com/
Select Developer Portal in the top right as shown above.
Select the option to Sign up for a Free Account towards the bottom of he page.
You’ll then need to write a 250 character or more essay and agree to to all the Terms and Conditions before you Submit.
Now select the COG under the default project name that has been created for you as shown above.
Select the Edit button as shown above.
Select the Delete App button at the bottom of the page. I found that the default app did not have the correct permissions and access so I removed it and created a new one with the right settings.
Make sure copy the name of the app because you’ll need to enter at the next dialog before pressing Delete app.
Back in the projects dashboard select Add an App as shown above.
Give the app a meaningful name select Next at the bottom of the page.
Copy the API Key and API Key Secret for later use. Make sure you DO SAVE both the API Key and API Key Secret as they’ll be needed back in Power Automate.Also, keep both of these secure as they control access to your Twitter account.
Select App settings at the bottom of the page to continue.
Select the Set up button under the User authentication settings towards the bottom of the page as shown above
Ensure:
App permissions = Read and write and Direct message
Type of App = Web App, Automated App or Bot
Call Back URI / Redirect URI = https://global.consent.azure-apim.net/redirect
Website URL = https://global.consent.azure-apim.net/redirect
Select he option to Save at the bottom of the page. Select Yes when the above dialog appears to confirm.
You’ll now see a Client ID and Client Secret as shown above. You won’t need these so simply select Done to continue. You can re-create them if needed later.
Select Yes, I saved it to continue.
Step 3. Reconnect Twitter account in Power Automate
Return to Power Automate, Data, Connectors
Select New connection from the top of the page as shown above.
Search for Twitter using the Search box in the upper right. Then select the Twitter connector to configure it.
Ensure:
Authentication type = Bring your own application
Consumer key = API Key
Consumer secret = API Key Secret
A browser pop up will now appear asking you to authorize access to your Twitter account. You’ll need to login here with your Twitter account details. Enter you login details and select Authorize app.
You should then see a confirmation appear in this dialog and the browser pop up window will now close.
In the list of connections should now appear an entry for Twitter as shown above, and it it should show as Connected.
If you now navigate to where the Twitter action is inside your Flows you should see that the existing one is invalid as shown above.
Select the ellipse in the top right hand corner and from the menu that appears select Delete. I found I had to minimise the Twitter action first to allow it to be deleted.
You can now create a new Twitter action which will use the new connector and API that was created.
With that all done you should now Save your Flow and test it to ensure it is working as expected.
In summary, you’ll firstly need to check the existing configuration for any Twitter actions you have in a Flow and record these. Next, you’ll need to remove any and all existing Twitter connections in Power Automate. Remember, there maybe more than one. Next, you’ll need to go Developer area in Twitter. There you’ll need to delete the default app that is created and create a new one. When you create a new one you’ll receive credentials you’ll need to save and use back in Power Automate. Once created you’ll need to configure it with a few additional settings. With that complete, you’ll return to Power Automate and create a new Twitter data connection with the credentials obtained. Finally, you’ll need to remove the old Twitter actions from your Flows and create new ones.
As I said, this process worked for me and I hope it does for you.
Thanks for the post!
I’m having an issue getting this to work, and I’m curious – is this *STILL* working for you? It hasn’t been long since you posted this, but I get errors about needing to request “elevated access” in my Twitter developer account, which doesn’t seem to actually exist.
LikeLike
Still works here. Ensure you delete the default API app in Twitter and create a NEW one. Otherwise it will not work.
LikeLike
Also don’t forget there are Twitter API limits on how often this can be used. Ensure you are not exceeding the limits in the free offering.
LikeLike
Reblogged this on Nishant Rana's Weblog.
LikeLike
Are you creating a V2 app or standalone V1 app?
LikeLike
Where exactly? Twitter or Power Automate?
LikeLike
I get 403 error on trying to Post a tweet using Power Automate.
LikeLike
That is a Forbidden error which means the connection to Twitter is not correct. I suggest you re check your config. Ensure you delete the default app and create a new one when you configure Twitter
LikeLike
I deleted all apps from Twitter Dev, create a Standalone App set Oauth 1 for read, write and dm, and Oauth 2 as Web app and set callback url and website to https://global.consent.azure-apim.net/redirect. I can create the Twitter Connection in Power Automate (using api key and secret)- no problem all seems to work well. But when I try to run “Post a Tweet” action, I get the following 403 error:
You currently have access to Twitter API v2 endpoints and limited v1.1 endpoints only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve
clientRequestId: 3419f90a-cee0-4347-889a-f09b103053c9
serviceRequestId: 42a054fec5df8c29a9e20c831cd750f0af244ee45975562a9819a8d85bf8d5e5
LikeLike
I can’t anything further apart from what is in my blog post which is working for me. It is an issue with Twitter not Power Automate. Sorry, all I can suggest is you double check all your settings, especially that you are using the right API key and are not exceeding the Twitter API rate limit.
LikeLike
Yes it’s odd. I think they have changed something very recently. I setup a new Dev account from scratch and then used those api keys in power automate (as this still allows you to log on to your twitter account), and that doesn’t work either. Are you using a Free account when you are posting or are you paying for twitter api?
LikeLike
I use the free account exactly per the blog post. Have since I wrote the post. I use it many times and day with various Flows and have no issues.
LikeLike