0
votes

When i open in browser address http://127.0.0.1:5280/api/check_account i get error

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

Config:

port: 5280
ip: "127.0.0.1"
module: ejabberd_http
request_handlers:
  "/websocket": ejabberd_http_ws
  "/api": mod_http_api
register: true
web_admin: true
http_bind: true
captcha: false
api_permissions:
"API used from localhost allows all calls":
- who:
  - ip: "127.0.0.1/8"
- what:
  - "*"
  - "!stop"
  - "!start" 
1

1 Answers

0
votes

Make sure you are asking a POST request using this tow parameters: "user" and "host" . your navigator use a GET request and such request can't be handled since no operation is implemented on the API

POST /api/check_account
   {
       "user": "peter",
       "host": "myserver.com"
   }

Use tools like : PostMan or Fiddler to test Http Requests on your server

Read the docs here : https://docs.ejabberd.im/developer/ejabberd-api/admin-api/