1

I am using privatemsg services module to create REST API of privatemsg using Services Module in Drupal 7.

I need to know how to send message and how to reply to a message ? Please tell me URL where i should send POST request and the Body of request ?

0

Here you go

To send new message

Endpoint: http://example.com/services/privatemsg

Content to Send (JSON Format) :

{
   "recipients": "xxx",
   "subject":"xxx",
   "body":"xxxx"
}

To reply a message for particular chat thread

Endpoint: http://example.com/services/privatemsg

{
"thread_id": "xxx",
"subject": "xxx",
"recipients":"xxx",
"body":"xxx"
}
| improve this answer | |
  • Thank you. It worked but can you please tell me how to get recipients name ? For example I am trying to send message to Krishna and I don't know complete name so when I enter "@kri" it should give me suggestion of user names starting with "kri" ? – Malik Jul 14 '16 at 9:04
  • I have asked a new question with more explanation hope I can get answer from you. Here is URL : drupal.stackexchange.com/questions/207180/… – Malik Jul 15 '16 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.