I'm currently working on integrating one to one chat in a web application using ejabberd.
I have tried to send message through send_message
api to the user1 from user2.
POST /api/send_message
{
"type": "headline",
"from": "user2@localhost",
"to": "user1@localhost",
"subject": "Testing",
"body": "Sample message from user2"
}
When I opened pidgin
I could see the message from user2
. I received 0
as response which means success (as mentioned in the documentation).
Until I opened pidgin
and see the message, The message has been treated as offline message. I could see that from the admin panel.
Now my question is How could I fetch all the messages between the user1
and user2
through a REST API endpoint?
Like how we use send_message
endpoint to send message to an user from a different user.
There is no API to view messages stored in offline (or in MAM archive).
Three possibilities: