我们需要在 Glip 中获取新未读消息的通知。我试图在 API 文档中找到它,但没有看到。有人知道这是否可用吗?
最佳答案
要在 Glip 中接收新消息的通知,请使用以下事件过滤器订阅 webhook 或 PubNub 通知。
/restapi/v1.0/glip/posts
这将为您的用户(可以是普通用户或聊天机器人用户)发送所有新帖子的事件。阅读更多信息:https://developers.ringcentral.com/api-reference/Team-Messaging-Post-Event
glip-client
SDK 中提供了 JavaScript 实现:
https://github.com/ringcentral/ringcentral-chatbot-js
specific lines are at L139-L143 .
await this.rc.post('/restapi/v1.0/subscription', {
eventFilters: [
'/restapi/v1.0/glip/posts',
'/restapi/v1.0/glip/groups',
'/restapi/v1.0/account/~/extension/~',
],
expiresIn: 473040000, // 15 years
deliveryMode: {
transportType: 'WebHook',
address: process.env.RINGCENTRAL_CHATBOT_SERVER + '/bot/webhook',
},
});
关于push-notification - RingCentral Glip 通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60841819/