Twitter API : Error: Request failed with code 403 (image upload)

Viewed 608

There are a few things I don't understand about the Twitter API. I am using the following package: https://www.npmjs.com/package/twitter-api-v2

Which allows me to connect to a twitter account. I recover all the credentials of the connected account. (Among other things, I manage to recover user data and send simple tweets)

I am trying to upload an image.

So I have the following code:

const result = await client.v1.post(
        "media/upload.json",
        {
          command: "INIT",
          media: file,
        },
        {
          prefix: "https://upload.twitter.com/1.1/",
        }
      );

And I got the following error returned to me:

Error: Request failed with code 403 - You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you'll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve (Twitter code 453)

I have read and write permissions. (since I manage to send tweets)

I understand that the V2 api of twitter does not allow image upload, but here I am using V1?

Can you give some information ?

0 Answers
Related