Reputation: 31
We need the get notifications of new unread messages in Glip. I tried to find this in the API documentation but do not see. Anyone know if that is available?
Upvotes: 3
Views: 145
Reputation: 211
To receive notifications for new messages in Glip, subscribe for webhook or PubNub notifications with the following event filter.
/restapi/v1.0/glip/posts
This will send you events for all new posts for your user whiich can be a regular user or a chatbot user. Read more at: https://developers.ringcentral.com/api-reference/Team-Messaging-Post-Event
A JavaScript implementation is available in the glip-client
SDK:
https://github.com/ringcentral/ringcentral-chatbot-js
The 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',
},
});
Upvotes: 1