Twitter-API-v2-sample-code icon indicating copy to clipboard operation
Twitter-API-v2-sample-code copied to clipboard

Authentication Error (403 Forbidden) when Running Twitter Bot

Open PtPrashantTripathi opened this issue 11 months ago • 8 comments

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.

PtPrashantTripathi avatar Jul 31 '23 18:07 PtPrashantTripathi