I am trying to tweet an image from Mathematica. I know, this should work on 11, but I am still using 10. My bad.
How I understand that it should work
- get an authorisation token. Check.
Upload an image, JPG format. Initiate the upload (command=INIT):
"upload...1.1/media/upload.json&command=INIT&total_\ bytes=" <> bytecount<> "&media_data=<>jpeg<>&media_type=image/jpeg"
I used
ExportToString
to convert the jpg in a string format. This gives me themedia_id _string
Tweet using the obtained media_id _string:
"api...statuses/update.json?status=2CV&media_ids=803254834484879360"
Which gives the error:
{"errors":[{"code":324,"message":"Invalid media id 803254834484879360"}]}
Checking with FINALISE suggests "error":"Segments do not add up to provided total file size." i.e. I did not do the base64 encoding and byte count correctly. Which probably is the case, since upload and post using this nice site: http://django-rest-apis.herokuapp.com/media from which i learned it should work.
Anybody any suggestion?