Authorizing request POST DirectMessage




I want to make request to the Twitter api to send direct messages, i’m having trouble since i have a error 401. I have severals questions :

Thank you very much


Please, i still need help


You have to use three-legged authentication with a user context in order to send Direct Messages. Application-only authentication has no user context, so it would not be possible to identify which user was sending a message to which other user.


Thank you. Three-legged authentification isn’t convenient for me as my service doesn’t include a HCI.

what i want to do is :

  • A user wants to be contacted, he types his screen_name.
  • The web service send the screen_name to me.
  • I receive the screen_name, and post a direct message to him (if he doesn’t have the option “receive dm from anyone” activated he won’t get the message).

I am a little lost, i know it’s a lot but i’d appreciate it if someone could help me