0

当我在浏览器地址http://127.0.0.1:5280/api/check_account中打开时 出现错误

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

配置:

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" 
4

1 回答 1

0

确保您使用以下两个参数询问 POST 请求: "user" 和 "host" 。您的导航器使用 GET 请求,并且由于 API 上未实施任何操作,因此无法处理此类请求

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

使用以下工具:PostMan 或 Fiddler 在您的服务器上测试 Http 请求

在此处阅读文档:https ://docs.ejabberd.im/developer/ejabberd-api/admin-api/

于 2017-04-18T19:33:54.147 回答