我已在ubuntu 18.04LTS(由aws托管)上配置了ejabberd 18.12.1
我试图使用 admin 帐户致电http://:5280 / api / send_stanza,但出现以下错误:
{
"status": "error",
"code": 32,
"message": "AccessRules: Account does not have the right to perform
the operation."
}
我在ejabberd.yml中具有以下配置
{ port: 5280
ip: "::"
module: ejabberd_http
web_admin: true
request_handlers:
"/api": mod_http_api
-
port: 5443
ip: "::"
module: ejabberd_http
request_handlers:
"/api": mod_http_api
"/bosh": mod_bosh
"/upload": mod_http_upload
"/ws": ejabberd_http_ws
"/oauth": ejabberd_oauth
web_admin: true
captcha: false
tls: true
}
这是“ API权限”部分
{api_permissions:
"console commands":
from:
- ejabberd_ctl
who: all
what: "*"
"admin access":
who:
- access:
- allow:
- acl: loopback
- acl: admin
- oauth:
- scope: "ejabberd:admin"
- access:
- allow:
- acl: loopback
- acl: admin
what:
- "*"
- "!stop"
- "!start"
"public commands":
who:
- ip: "127.0.0.1/8"
what:
- "status"
- "connected_users_number"
}
请注意,我已经在本地Mac上安装并配置了具有相同配置的相同版本,并且api调用成功。