Media upload (upload.json) endpoint


#1

hi, I have been trying to use this resource to load a base64 image with no luck.

First, all the documentation is about upload_with_media option, but in the documentation says it is deprecated. Anyway i tried too, and this is the result :

code":195,“message”:"Missing or invalid url parameter

with: this header

–limite
Content-Disposition: form-data; name=status

abcdef
–limite
Content-Disposition: form-data; name=media[]; type=‘png’; filename='queno-20141004-152911.png’
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64

iVB…(base64 string)

So, i tried to load with multiple photos option, and the documentation does not specify details about the format to use, it only mentions twurl example, but no information about the header in other languages (or AJAX HEADER required)

Finally i sent the api call, with oauth ok, but all the time i get a “{“errors”:[{“code”:38,“message”:“media parameter is missing.”} .” when trying to send a image (png file) in base64 created in a canvas (javascript) option URL, received in ASP and included in this header:

URL : https://upload.twitter.com/1.1/media/upload.json?status=%23QN%20%20http%3A%2F%2Fwww.quenota.com%2Fqn.asp%3FENV%3DQN%26vid%3Dqueno-20141004-152911.xml%20%23QueNota%20%20%3A-|

HEADER
–limite
Content-Disposition: form-data; name=media[]; type=‘png’; filename='queno-20141004-152911.png’
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64

iVBORw0…

I appreciate any help.

thanks


#3

There’s a possible solution here: POST media/upload.json always returns “media parameter is missing"