Hi everyone
I have an issue with Twitter API V2.
First of all the documentation is a bit outdated, I think Twitter has made some new changes in their developer portal
Also I still have many problems using a simple node of twitter
After credential setup, I am not able to test even with a simple tweet creation.
My error message is
You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve
Stack
NodeApiError: Forbidden - perhaps check your credentials?
at Object.twitterApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Twitter/GenericFunctions.js:26:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Twitter/Twitter.node.js:153:40)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:652:28)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:592:53
Could this be a bug due to some twitter API changes ?
The node is a bit outdated and we are aware that it needs an update but looking at the message you are getting back from Twitter you would need the Elevated access to use the node.
You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: Getting Started with the Twitter API | Docs | Twitter Developer Platform
Hey @Jon !
Aouch I see, ok it makes sense
Any plan to support v2 soon ? Elevated access jumps straight to 40$/months, which is a bit too much for my use case.
Any other alternative you can suggest to bypass this node in order to post tweets. The mode itself come in the middle of a larger workflow, any clever bypassing alternative will be more than welcome
We do plan to update the node but we also want to introduce PKCE support at the same time which is a fairly large change and may involve swapping out the oauth package we use which will need a lot of testing.
As a workaround you could try using the HTTP Request node to send to the v2 api but I have not tried this yet.
Hi guys,
Sorry for the delay
So yes, all you have to do is the following:
1- Grad an HTTP Request node
2- Use the following details:
Method : POST
URL : https://api.twitter.com/2/tweets
Authentication : Predefined Credential Type
Credential Type : Twitter OAuth API
Credential : You have to set this one following the Docs on Twitter side : basically go to Twitter Developer, Create an account, generate Keys and link them here
Toggle “Send body”
Body Content Type : Json
Specify Body : Using Fields Below
Body Parameters : TEXT , Value : Whatever you feed that node (this will be your tweet text)
This is how I use it on my end and it is working very well for me
I’m still getting an error. I recreated the keys (even deleting the app in Twitter and generating new keys), and linked the keys, but still getting ang “401 error”:
{"status":"rejected","reason":{"message":"Authorization failed - please check your credentials","timestamp":1686721951975,"name":"NodeApiError","description":"{\n \"title\": \"Unauthorized\",\n \"type\": \"about:blank\",\n \"status\": 401,\n \"detail\": \"Unauthorized\"\n}","context":{},"cause":{"message":"401 - \"{\\n \\\"title\\\": \\\"Unauthorized\\\",\\n \\\"type\\\": \\\"about:blank\\\",\\n \\\"status\\\": 401,\\n \\\"detail\\\": \\\"Unauthorized\\\"\\n}\"","name":"Error","stack":"Error: 401 - \"{\\n \\\"title\\\": \\\"Unauthorized\\\",\\n \\\"type\\\": \\\"about:blank\\\",\\n \\\"status\\\": 401,\\n \\\"detail\\\": \\\"Unauthorized\\\"\\n}\"\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at RedirectableRequest.handleResponse (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:238:9)\n at RedirectableRequest.emit (node:events:525:35)\n at RedirectableRequest.emit (node:domain:489:12)\n at RedirectableRequest._processResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:356:10)\n at ClientRequest.RedirectableRequest._onNativeResponse (/usr/local/lib/node_modules/n8n/node_modules/follow-redirects/index.js:62:10)\n at Object.onceWrapper (node:events:628:26)\n at ClientRequest.emit (node:events:525:35)\n at ClientRequest.emit (node:domain:489:12)\n at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)\n at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)\n at TLSSocket.socketOnData (node:_http_client:534:22)\n at TLSSocket.emit (node:events:513:28)\n at TLSSocket.emit (node:domain:489:12)\n at addChunk (node:internal/streams/readable:315:12)\n at readableAddChunk (node:internal/streams/readable:289:9)\n at TLSSocket.Readable.push (node:internal/streams/readable:228:10)\n at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)"}}}
Hi Rad,
Thanks for your share. I did it as you mentioned above. The twitter connected already. But it has following problem, could you help how solve this problem? Many thanks!
ERROR: Forbidden - perhaps check your credentials?
{“title”:“Forbidden”,“status”:403,“detail”:“Your client app is not configured with the appropriate oauth1 app permissions for this endpoint.”,“type”:“Twitter API Response Codes & Error Support | Twitter Developer Platform”}