POST to media/upload return media Id but using that media Id in statuses/update return invalid

media
media-upload

#1

Hi,

I receive this error when trying to make a tweet with image.

Response Status: '400 Bad Request' Response Code: 400 Response Body: {"errors":[{"code":44,"message":"media parameter is invalid."}]}
I’ve tried different images. For images larger than 3MB, it does return media Id. However, when trying to use that media Id, it says “media parameter is invalid”. Everything works fine with images less than 3MB. The image format are jpg and png

Shouldn’t the limit be 5MB according to the documentation?


#2

I’m having the same issue.

I am able to upload an image and get the media ID back, but when I try to do a status update with any media ID I get the above error.

I’d love to know what ‘media’ parameter this is talking about, I have not specified a media parameter.


#3

I solved my problem by using the media_id_string rather than the media_id in the status update.


#4

I’ve tried both media_id and media_id_string but no luck


#5

I’m getting the same error, but with a small mp4 video upload.


#6

Appreciate you guys posting. Just made a small tool to let you test uploading your media files to Twitter. It supports both media upload, as well as using binary and base64 options.

http://django-rest-apis.herokuapp.com/media

If you want to run it locally, the source available here:

Let me know how your media fares with this upload tool, and if continues to see errors in upload, post your media content and response you get from the tool here.


#7

Do you have library for Go?


#8

Getting the same error when tried to upload image available at the url http://www.dr4ward.com/.a/6a00e54fd9f059883301bb0896d489970d-800wi. Can some one please help me in finding out the limitations with tweet creation.


#9

Hi @rchoi thanks for writing this media upload tool! I did try the video we’ve been trying to get to Twitter through it (https://snd-staging.s3.amazonaws.com/6b8cf261-dffc-11e5-886f-4f6f38c83520.mp4) and replicated the same “media parameter is invalid” error we’re getting on our side too.

I checked the Video Inspector in QuickTime and all seems within Twitter’s requirements. Any idea what else could be causing this failure? Thanks!

Eric Nograles


#10

can you provide the media so i can test and debug on our side?


#11

twitter updated the doc on the media/upload endpoint here: https://dev.twitter.com/rest/public/uploading-media

And the answer of your question can be explained by this:
The maximum image size for this endpoint(uploading-media) is 5MB. Depending on how the image is used, further limits apply. For example, if the image is attached to a Tweet, the maximum limit in this case is 3MB.


#12

Hello sir, I share the video on twitter and I got the Media Of that but from that media didn’t get the twitter fav and retweet count it showing the
ERROR: No status found with that ID.

but before some days it showing the count of that video ID.

Twitter changes API…?