【发布时间】:2018-11-03 07:56:18
【问题描述】:
我在ejabberd 16.09 上配置Ejabberd Rest API。要配置它,我只是关注 ejabberd 文档 (https://docs.ejabberd.im/developer/ejabberd-api/simple-configuration/)。所以当我要用body: 打邮递员的http://localhost:5280/api/change_password url 时
{
"user": "123",
"host": "TT_CPU_076",
"newpass": "blank"
}
和header: Content-Type: application/json. 我收到如下错误:
{
"status": "error",
"code": 31,
"message": "Command need to be run with admin priviledge."
}
我的 ejabberd.yml 文件配置如下:
port: 5280
module: ejabberd_http
ip: "127.0.0.1"
request_handlers:
"/websocket": ejabberd_http_ws
"/api": mod_http_api
## "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
## register: true
captcha: false
api_permissions:
"API used from localhost allows all calls":
- who:
- ip: "127.0.0.1/8"
- what:
- "*"
- "!stop"
- "!start"
任何使用 ejabberd 实现 Rest Api 配置的解决方案都将不胜感激。
【问题讨论】:
标签: rest ejabberd ejabberd-auth