Hello
I am trying to get the POST /1.1/direct_messages/events/new.json to work.
I am using twurl, and uploading media and then passing media id to the new.json post
The upload completes successfully
the Direct message post completes successfully if the attachment is not included
I am getting the 415 unsupported media type returned when adding the media attachment.
Note the upload returns a media_key that starts with 5_######### (same as media_id)
I am using twurl
The upload is:
twurl -H upload.twitter.com /1.1/media/upload.json?media_category=dm_image -f ~/plot.png -F media -X POST -t
and I have tried
twurl -H upload.twitter.com /1.1/media/upload.json -d media_category=dm_image -f ~/plot.png -F media -X POST -t
The direct message call is:
twurl -A 'Content-type: application/json' -X POST /1.1/direct_messages/events/new.json -d '{"event": {"type": "message_create", "message_create": {"target": {"recipient_id": "8461682593########"}, "message_data": {"text": "picture post", "attachment": {"type": "media","media": {"id": "895066<returned from upload>"}}}}}' -t