我使用SendBird平台API在我的网站上创建聊天,当我尝试使用以下API检索以前在频道中发送的消息:
https://api.sendbird.com/v3/ {CHANNEL_TYPE} / {channel_url} /消息
方法:GET
请求:?message_ts = long(必需)&prev_limit = int(可选,默认值:15,0~200)&next_limit = int(可选,默认值:15,0~200)&include = boolean(可选,默认值:true)&reverse = boolean (可选,默认值:false)&custom_type = string(可选)&message_type = string(可选)&sender_id = string(可选)
将值传递给上述请求后,我得到一个错误说
{“message”:“未授权。获取消息功能只能从Park或Enterprise计划中调用。”,“code”:400108,“error”:true}
有人可以帮我这个
感谢Nitin
您正在调用的Message Retrieval API是一个高级功能,您可以在Senbird的Pricing Page中看到。
您必须联系Sendbird并升级到其高级计划才能检索消息并成功呼叫端点。
您可以在SDK中检索消息(也可用于JavaScript)。
在Android中调用此方法,
mChannel.getPreviousMessagesByTimestamp()
其中mChannel
是GroupChannel
类型的对象(也允许OpenChannel
)。
据我所知,可以检索这样的消息。
对于Javascript refer to this link