Hello,
We would like to be able to use n8n to automate social media posts containing images to X/Twitter. The only way to post images is via OAuth1. However, n8n has deprecated their support of OAuth1 as of version 0.236.0.
We think it would be beneficial to add this functionality back because we imagine we are not the only ones wishing to post images to X/Twitter using n8n automation.
Would it be possible to continue supporting OAuth1 for this purpose of uploading media to X/Twitter using n8n automation?
I managed to post to X with image (single image only). I’m still struggling with videos, and that INIT > APPEND > FINALIZE method.
However, I’m facing an issue with authentication and scopes, that you can check here:
In order to upload image, I’m using HTTP request node and a generic OAuth2 credential.
Set grant type = PKCE
Authorization URL = https://x.com/i/oauth2/authorize
Access Token URL = https://api.x.com/2/oauth2/token
Scope = media.write offline.access
So, here is where i’m having issues. When I use media.write, I can’t use together with tweet.write. So I have to set up another credential (predefined X OAuth2) to post the tweet. You just have to carry the media_id. I’m using two workflows, one to upload image, and another to post the tweet with media_id. Still trying to figure out this issue.
Check this link to find the “Upload image” node. Just set the credential as described above, and chage the URL to https://api.x.com/2/media/upload
This way is working for me, but I’m still trying to solve the scopes / authentication issue.
Hi @ericocheung,
Thank you for sharing this update! I am in fact very lucky to have @Raphael-Joel_Lim as my coworker. We are working on this project together! Kudos to you both for your help
I’m having the same issue. I’ve been unsuccessful in uploading an n8n binary to X. This is the closest I’ve come, but it’s turning the binary into the source URL instead of uploading the binary to X.
above link for 90997 is private or removed? I thought Id mention this if not know - X workaround with twitterapi.io. I’ve been running into the same OAuth1 deprecation headache for posting images to X. I have a an auto-posting flow that first generates a Meme Image, then combines with generted text for full X Quote Post tweet, or Reply tweet. I also stuck with the classic v1.1 media upload endpoint using a Generic OAuth1 credential in an HTTP Request node (it still works fine despite the warnings).
I have begun using twitterapi.io to circumvent X restrictions on auto-posting. Im not a rep at all but its pretty under-the-radar but super cheap.
Maybe helpful to bridge the gap while OAuth2 setups (like mutedjam’s media.write one) get dialed in. The 1st part of this sample flow shows the nodes I used; Ggl Shts is optional but handles a ssn cookie factor needed for using that api.