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.61k stars 967 forks source link

Getting Tweets with Bearer Token is not working #153

Open toramanomer opened 3 months ago

toramanomer commented 3 months ago

Describe the bug Getting Tweets with Bearer token is not working. It returns 403 Forbidden with the following response body:

{
    "client_id": "28572299",
    "detail": "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.",
    "registration_url": "https://developer.twitter.com/en/docs/projects/overview",
    "title": "Client Forbidden",
    "required_enrollment": "Appropriate Level of API Access",
    "reason": "client-not-enrolled",
    "type": "https://api.twitter.com/2/problems/client-forbidden"
}

To Reproduce

Expected behavior A successful response with the requested tweets.

Additional context Add any other context about the problem here.