3

我们需要在 Glip 中获取新的未读消息的通知。我试图在 API 文档中找到它,但没有看到。有谁知道这是否可用?

4

1 回答 1

1

要在 Glip 中接收新消息的通知,请使用以下事件过滤器订阅 webhook 或 PubNub 通知。

/restapi/v1.0/glip/posts

这将为您的用户发送所有新帖子的事件,该用户可以是普通用户或聊天机器人用户。阅读更多:https ://developers.ringcentral.com/api-reference/Team-Messaging-Post-Event

glip-clientSDK中提供了一个 JavaScript 实现:

https://github.com/ringcentral/ringcentral-chatbot-js

具体线路在 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',
        },
      });
于 2020-04-12T18:11:59.723 回答