Hi,
We are trying to access Twitter API for Welcome Messages.
We have used OAuth 1.0 with Consumer Key, Consumer Secret, Access Token and Token Secret.
All other API such as tweets etc are working fine and credentials were allowed using OAuth 2.0.
But when using welcome message API, we are getting error - "Your credentials do not allow access to this resource.”
See screenshot attached.
Kind regards,
Hassan
Does the app have “Read, Write & DM” Permissions in https://developer.twitter.com/en/portal/projects-and-apps settings?
Also do not share your keys - they should be treated as passwords - those should not be public Authentication best practices | Docs | Twitter Developer Platform
@IgorBrigadir thanks for your reply. Yes, the app has “Read, Write & DM” permission see the screen attached.
Sometimes resetting keys works - especially if you’ve changed the permissions after generating them.
@IgorBrigadir I did that few times. Those are new keys, tokens etc…
Do the keys work in something that’s not Postman? I’ve seen others have similar authentication issues with it
Twurl always works for me and handles all the auth stuff: GitHub - twitter/twurl: OAuth-enabled curl for the Twitter API
eg:
twurl "/1.1/direct_messages/welcome_messages/list.json"
is the equivalent call to the above.
@IgorBrigadir I also, tried that few times, and the authorization is successful. But I’m getting an error when I call the API below;
twurl “/1.1/direct_messages/welcome_messages/list.json”
See screenshot attached.
1 Like
@andypiper need help with this, please.
If this works:
twurl "/1.1/account/verify_credentials.json"
Does another DM endpoint work?
twurl "/1.1/direct_messages/events/list.json"
Also, is your system clock in sync (it can affect oauth sometimes if it drifts)?
@IgorBrigadir none of the above is working. I can confirm my system clock in sync.
weird - if you got “Authorization Successful” from twurl it should have been working.
i’d try to reset my keys again (consumer keys), and re-authenticate, but this time give it a few minutes and try to authorize twurl again and see if that works. But i’ve no reasoning for doing that aside from maybe something on twitter’s end needs more time to appear
So you are saying that twurl /1.1/account/verify_credentials.json is not working.
Please provide specific errors and outputs. It is impossible to help if we do not know what your errors are. I assume you’ve explored all errors before asking on the forums.
system
Closed
#13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.