Open campgurus opened 1 year ago
This often happens when a Twitter App isn't a member of a project. Head to your projects & apps overview page - if your app appears under "Standalone Apps" you'll need to create a project and assign the app to it
The App is within a project. screenshot:
Ah sorry - I'm not affiliated with this library but I'd just had that problem myself recently, was a bit of a shot in the dark!
On closer inspection it looks like a basic authentication issue - what happens if you call twitterClient.v1.verifyCredentials()
?
No worries grateful for the help. Meanwhile, I think I don't have access to v1:
ApiResponseError: Request failed with code 403 - Your credentials do not allow access to this resource (Twitter code 37)
at RequestHandlerHelper.createResponseError (/Users/darius/Code/flumly-bot/node_modules/twitter-api-v2/dist/cjs/client-mixins/request-handler.helper.js:104:16)
at RequestHandlerHelper.onResponseEndHandler (/Users/darius/Code/flumly-bot/node_modules/twitter-api-v2/dist/cjs/client-mixins/request-handler.helper.js:262:25)
at Gunzip.emit (node:events:513:28)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
error: true,
type: 'response',
code: 403,
headers: {
date: 'Fri, 20 Oct 2023 11:17:20 UTC',
perf: '7626143928',
server: 'tsa_b',
'set-cookie': [
'guest_id_marketing=v1%3A169780064063369209; Max-Age=63072000; Expires=Sun, 19 Oct 2025 11:17:20 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None',
'guest_id_ads=v1%3A169780064063369209; Max-Age=63072000; Expires=Sun, 19 Oct 2025 11:17:20 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None',
'personalization_id="v1_kxZM5/LOaZoQG0/8kpgZuQ=="; Max-Age=63072000; Expires=Sun, 19 Oct 2025 11:17:20 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None',
'guest_id=v1%3A169780064063369209; Max-Age=63072000; Expires=Sun, 19 Oct 2025 11:17:20 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None'
],
'content-type': 'application/json;charset=utf-8',
'cache-control': 'no-cache, no-store, max-age=0',
'x-transaction-id': 'd3171bde74e8da0b',
'strict-transport-security': 'max-age=631138519',
'content-encoding': 'gzip',
'content-length': '106',
'x-response-time': '4',
'x-connection-hash': 'c5163e55a1a73330ff02f2aae694e224e1645f5e29dbd0558c0eb2cb0af76eff',
connection: 'close'
},
rateLimit: undefined,
data: { errors: [ [Object] ] },
errors: [
{
message: 'Your credentials do not allow access to this resource',
code: 37
}
]
Facing the same issue here
EDIT: I resolved the issue by configuring the authentication settings and subsequently generating new API and secret keys
I'm also facing the same 403 error.
I am getting the same error when I try to upload Media. Did anyone had any success with this error?
same error here
I am getting the same error when I try to upload Media. Did anyone had any success with this error?
Did you ever figure it out? Having the same issue here π
I am getting the same error when I try to upload Media. Did anyone had any success with this error?
Did you ever figure it out? Having the same issue here π
that makes two of us :(
I am getting the same error when I try to upload Media. Did anyone had any success with this error?
Did you ever figure it out? Having the same issue here π
that makes two of us :(
@cheskoxd my solution is here!
https://github.com/PLhery/node-twitter-api-v2/discussions/416#discussioncomment-8684794
Thanks!!
Facing the same issue here
EDIT: I resolved the issue by configuring the authentication settings and subsequently generating new API and secret keys
Thanks @sir-kain I was also able to fix this issue simply by regenerating keys.
Note: For questions about how to use an endpoint, or problems related to Twitter API than the lib itself, please use the GitHub Discussions instead of opening a new issue.
Trying to create a Twitter bot in Node.js. Getting a 403 error on the request.
here is the full error trace:
here is my client config:
and index.js