I am using ejabberd-18.01 on Windows 10 (localhost). I am trying to connect to ejabberd via Postman using the web method:
POST: localhost:5280/api/specific_api_method
As per the official API documentation (https://docs.ejabberd.im/developer/ejabberd-api/admin-api/), I am trying to add a roster item using the POST method with the body that follows:
POST: localhost:5280/api/add_rosteritem
{
"localuser": "user1",
"localserver": "mydomain",
"user": "admin",
"server": "mydomain",
"nick": "u1",
"group": "Friends",
"subs": "both"
}
I am getting an error:
{
"status": "error",
"code": 32,
"message": "AccessRules: Account does not have the right to perform the operation."
}
I will be grateful if somebody can guide me how to authenticate myself and add a new user or roster item to ejabberd using the web API. Thanks.
make these changes in your yml file config file
change loopback in acl to this:
and use this api_permissions:
this issue have been closed at : Access denied issue on ejabberd