【问题标题】:Openfire send message using rest api in phpOpenfire使用php中的rest api发送消息
【发布时间】:2018-12-01 14:59:04
【问题描述】:

我正在使用 openfire。我可以添加用户和组。但现在卡在从一个用户向另一个用户发送消息。我正在浏览图书馆,但没有找到任何合适的。我尝试了 xmpp bosh 库,但出现错误:

"message": "Declaration of XMPPHP_BOSH::connect($server, $wait = '1', $session = false) should be compatible with XMPPHP_XMLStream::connect($timeout = 30, $persistent = false, $sendinit = true)",
    "exception": "ErrorException",

【问题讨论】:

标签: openfire sendmessage


【解决方案1】:

REST API 插件不提供您正在寻找的功能(1:1 消息传递)。 REST API 插件用于管理 Openfire 实例(用户、组、频道等)

要发送一对一消息,您可以使用 openfire 聊天插件。 (https://github.com/igniterealtime/openfire-chat)

示例:

POST /restapi/v1/chat/{streamid}/messages/{destination}

{
   "body" : "desired message"
}  

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多