2
What version of ejabberd are you using?

17.04

What operating system (version) are you using?

ubuntu 16.04

How did you install ejabberd (source, package, distribution)?
package

What did not work as expected? Are there error messages in the log? What
was the unexpected behavior? What was the expected result?

I used postman to make a HTTP request to ejabberd register api. The ejabberd is set up and the admin is running properly at the url - http://localhost:5280/admin.

The Url of http request is - http://localhost:5280/api/register

Body - { "user": "bob", "host": "example.com", "password": "SomEPass44" }

Header - [{"key":"Content-Type","value":"application/json","description":""}]

Response - { "status": "error", "code": 32, "message": "AccessRules: Account does not have the right to perform the operation." }

I searched a lot to and figured out that it will require some changes in ejabberd.yml file. My yml file is available on the link attached.

THIS LINK CONTAINS YML FILE

ANY HELP WILL GREAT.

Rishabh Pandey
  • 209
  • 1
  • 4
  • 16

1 Answers1

2

In config file /opt/ejabberd/conf/ejabberd.yml

Find api_permissions Change values of public commands who and what. Compare your code with mentioned below.

see this post:

http://www.centerofcode.com/configure-ejabberd-api-permissions-solve-account-not-right-perform-operation-issue/

pekle
  • 31
  • 2
  • 1
    The link was broken. – Linga Mar 02 '20 at 11:37
  • @pekle- Can you please update the answer with the correct link. – Praful Bagai Apr 18 '20 at 17:56
  • @LingasamySakthivel - were you able to rectify this? Kindly help – Praful Bagai Apr 18 '20 at 17:56
  • @PythonEnthusiast Yes, I resolved this. You should allow the api operation in the yaml file. By defaultI think only 2 options are allowed for the api. You should add the api method in the yml file. – Linga Apr 20 '20 at 05:48
  • I figured out that that too. Thanks @LingasamySakthivel. Can you pls have a look at https://stackoverflow.com/questions/61297053/ejabberd-fetch-the-history-messages-mod-mam-via-api . Would love to have your thoughts on it. – Praful Bagai Apr 20 '20 at 10:37