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.