-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authenticating error (api_version='2') #226
Comments
Looks good to me. Are you using the same credentials with Postman and TwitterAPI? I would add something to your code to confirm that your credentials are valid. |
Yes, I'm using the same exact credentials with Postman and TwitterAPI. What code do I need to add that check my credentials are valid? |
You could try other enpoints, such as searching for tweets, that don't require write privileges. I'm really not sure what to tell you. It doesn't make sense that the same credentials would would work in one case and not in the other. Are those credentials associated with a Twitter developer project? |
The error you are receiving is from Twitter, so it's impossible to for me to look into the cause. There must be some difference between your requests in Postman and in TwitterAPI. It might be helpful to try the same request using another library such as twarc. |
I see one thing you are doing wrong. The 'tweets' request, by default uses HTTP GET. You need to use HTTP POST in order to upload a tweet. Try this... |
Thank you! Problem fixed |
@qkxie How are you creating your `api` object?
…On Wed, Aug 2, 2023 at 10:18 PM qkxie ***@***.***> wrote:
I have the same error. even when I set method to post:
resp = api.request('tweets', {'text': 'testing api'}, method_override='POST')
It still return error message:
'{"title":"Forbidden","status":403,"detail":"Your client app is not configured with the appropriate oauth1 app permissions for this endpoint.","type":"https://api.twitter.com/2/problems/oauth1-permissions"}'
—
Reply to this email directly, view it on GitHub
<#226 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAWUOP6WPCPTSAYKERPHEALXTMC55ANCNFSM6AAAAAAXBERWKA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
api = TwitterAPI(consumer_key, consumer_secret, access_key, access_secret, api_version='2') |
Is there a problem with authentication requests or I'm doing something wrong?
I tried the Twitters API v2 postman with (OAuth 1.0) Consumer Key, Consumer Secret, Access Token, Token Secret after that creating a tweet with Twitters API v2 it worked perfectly.
code:
response:
The text was updated successfully, but these errors were encountered: