如何使用Python REST API在openfire中创建聊天室并将用户添加到聊天室

时间:2020-05-06 06:21:53

标签: python rest api xmpp openfire

我正在使用此模块Openfire REST API

我写了main.py import muc.py

from ofrestapi.muc import Muc
m = Muc(host = 'http://desktop-oam4s7o:9090', secret = 'poYixzhOJsPmB4tB')
m.add_room(roomname = 'test', name = 'test', description = 'test')

但是失败了,我遇到了一个异常:

ofrestapi.exception.InvalidResponseException:500

有人可以为MUC服务使用一些示例Python来创建聊天室并将用户添加到聊天室吗?

1 个答案:

答案 0 :(得分:0)

请参阅github中的以下示例代码可能会对您有所帮助,这是Openfire RestAPI的命令行界面: https://github.com/seamus-45/openfire-cli