Error code 131: Internal error while calling media/upload



I’m working on a command line tool and I want to add the posibility to upload media to refrence in tweets. My OAuth signature has been working with no problem with the update endpoint and the upload_with_media. But now that I’m adding the media upload I get the error from the subject inside an error http 500.
Any suggestions?


Can you provide self-contained sample code and the file that works/used to work?


Thanks for getting back at me @rchoi. It’s hard to provide a self-contained sample code but I’ll try to give you every info you need.

I uploaded a couple of files to my OneDrive so you can see what I’m seeing with Fiddler.
Here’s what I get when I try to send the raw file:
And this is the one in base64:

In both cases I get the error from the subject.
I also tried to use twurl in order to see what is it sending but I get another error :frowning: (mentioned here:

Here’s the pic I’m trying to upload. please let me know if there’s anything I can help you with in order to help me.


Hi @sebagomez, I was unable to reproduce this myself; I used the twurl call below to upload successfully. I’m reaching out to the Media Platform team in case they have any insight or know of common issues that would result in a 131.

twurl -H -X POST "/1.1/media/upload.json" --file "8d0ef4532ae15f9830160ce5af7062a0af340c3d.jpg" --file-field "media"


Tracking this internally as PREL-14340.


pasting this same command with twurl I get {"request":"\/1.1\/media\/upload.json","error":"media type unrecognized."} :frowning:

Win 8.1 x64 with ruby 2.2


Hey @jbulava @rchoi, any news on this issue?


Sorry for delay, and sure you’ve figured it out.

But I tested the file you uploaded via a quick tool, both as binary and base64, and it didn’t have any issues.

Tool is available here:

Source available here: