0
votes

I would like to send a message and I call api.

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"caller":"maituanmte%40localhost","to":"admin%40localhost","body": "Hi all"}' 'http://localhost:8088/api/messages'

the status=204 and body response no content. But when I get message by

curl -X GET --header 'Accept: application/json' 'http://localhost:8088/api/messages/admin%40localhost'

then status = 200 and body=[] (no messages). I have exchange admin and maituanmte but the same result.

Please help me. Thanks

1

1 Answers

3
votes

Messages will be returned from the server only if mod_mam is enabled. Could you confirm you have this module enabled and configured? I recommend using MongooseIM from master branch [1] as the MAM configuration was significantly simplified recently [2], [3]

[1]. https://github.com/esl/MongooseIM

[2]. https://github.com/esl/MongooseIM/blob/master/doc/modules/mod_mam.md

[3]. http://mongooseim.readthedocs.io/en/latest/modules/mod_mam/