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

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.

Open sriharigr-threado opened this issue 3 years ago • 4 comments

Describe the bug Context - We would like to use Full Archive v2 search/all endpoint. We have a premium subscription. We do not have a standalone app. We have a project and an app is added to it. I have tested using the bearer and also with the API keys. v2/search/recent works fine though. Only the v2/search/all is throwing below error.

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. "title": "Client Forbidden", "required_enrollment": "Standard Basic", "reason": "client-not-enrolled", To Reproduce

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

sriharigr-threado avatar Mar 17 '22 07:03 sriharigr-threado

I have the same issue - have you found a fix for it yet?

philldtaylor avatar May 23 '22 13:05 philldtaylor

The full archive search endpoint in v2 is only available with academic access.

andypiper avatar May 24 '22 15:05 andypiper

Now I am using this api

 await axios({
      method: "post",
      url: `https://api.twitter.com/2/dm_conversations/with/${received_user_id}/messages`,
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "Content-Type": "application/json",
        "Accept-Encoding": "gzip, deflate, br",
      },
      data: {
        text: "Hello World!",
      },
    })

And in this code, the received_user_id is User Id and the accessToken is that I created from my twitter app dashboard But when I run this code, it has some bugs like this image.😢 How can I fix it?😣 image

Typhon0130 avatar Aug 16 '23 16:08 Typhon0130