Attaching media to direct messages not working



I am trying to upload media in direct messages.By referring this documentation, I generated mediaId by setting media_category as dm_image and I constructed header using this endpoint.

And then I triggered POST request with end point -

 Content-Type - application/json
 content - {"event": {"type": "message_create","message_create": {"target": {"recipient_id": "4211191093"},"message_data": {"text": "Hello World!","attachment": {"type": "media","media": {"id": "859337626066833414"}}}}}}

and Content-Length

But I am getting 215 error message

  {"errors":[{"code":215,"message":"Bad Authentication data."}]}

I can’t able to find out what is missing in this request.Can anyone plz help me in this.



Is it definitely oAuth signed as I found that my iOS libraries simply didn’t like signing non multi-part form data until I rewrote it to accept JSON instead

Ensure the body isn’t included with the signing request but the Content-type header is


Constructed authorization header with Content-Type as application/json.Header does not contain object.Still same error persist.