Hi amazing developers,

I’m trying tweets with images using the official reference, but I get a 400 error no matter which media ID I pass.

{
   "errors":[
      {
         "parameters":{
            "media.media_ids":[
               "1455952740635586573"
            ]
         },
         "message":"Your media IDs are invalid."
      }
   ],
   "title":"Invalid Request",
   "detail":"One or more parameters to your request was invalid.",
   "type":"https://api.twitter.com/2/problems/invalid-request"
}

Thank you.

Hi,

I found the following useful reference after starting this thread and solved it myself!

But just wondering, does the Twitter API v2.0 endpoint provide a way to get the Media ID directly?

If we need to get the Media ID from the Media Key in Twitter API v2.0, I feel it would be better to specify that in the endpoint reference.

Thanks anyway.

2 Likes

This is a good “hint” - it would be a good idea to make this more clear in the documentation. Thank you for the suggestion.

2 Likes

hi, having a similar issue. i got media uploaded by the app tokens (bc we’re using OAuth2), then trying to attach it when creating a tweet with media_ids, tho bumping into the same error you have. How’ve you provided an argument? Thx!

Found the problem. I was missing additional_owners as I am posting on user’s behalf.

2 Likes