【发布时间】:2020-03-25 01:29:59
【问题描述】:
我们需要在 Glip 中获取新的未读消息的通知。我试图在 API 文档中找到它,但没有看到。有谁知道有没有?
【问题讨论】:
-
请参阅下面的更新答案。
标签: push-notification webhooks ringcentral glip
我们需要在 Glip 中获取新的未读消息的通知。我试图在 API 文档中找到它,但没有看到。有谁知道有没有?
【问题讨论】:
标签: push-notification webhooks ringcentral glip
要在 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',
},
});
【讨论】: