xdevplatform / Twitter-API-v2-sample-code

Sample code for the Twitter API v2 endpoints
https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api
Apache License 2.0
2.68k stars 987 forks source link

Authentication Error (403 Forbidden) when Running Twitter Bot #132

Open PtPrashantTripathi opened 1 year ago

PtPrashantTripathi commented 1 year ago

Description:

I am facing an authentication issue with the Twitter bot using the code from the repository https://github.com/vedicscriptures/twitter_bot/blob/main/main.py. Previously, it used to work without any problems, but now I am encountering a 403 Forbidden error during authentication.

Steps to Reproduce:

  1. Clone the repository: https://github.com/vedicscriptures/twitter_bot.git
  2. Run the command: python main.py
  3. Observe the authentication error mentioned below:
Run python main.py
  python main.py
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.8.17/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.17/x64/lib
    APIKey: ***
    APISecretKey: ***
    AccessToken: ***
    AccessTokenSecret: ***
    BearerToken: ***
2021-10-14
2023-07-31 18:09:40.196412
Error during authentication :
403 Forbidden
When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.

Links to Runs with the Issue:

  1. Successful Run URL: https://github.com/vedicscriptures/twitter_bot/actions/runs/5681881040/job/15398990021
  2. Failing Run URL: https://github.com/vedicscriptures/twitter_bot/actions/runs/5718104707/job/15493234567

Additional Information: I have confirmed that the code being used is the same as provided in the repository, and it was previously functional. However, after the recent run at the URL mentioned above, the authentication issue started occurring. Any assistance in resolving this problem would be greatly appreciated.

sshah98 commented 1 year ago

getting same errors

MarcusHSmith commented 1 year ago

any updates here?

PtPrashantTripathi commented 1 year ago

getting same errors

no

Abdelmohsin commented 10 months ago

i

did you provide DM api ?