Subscribe to a Topic
【API】
/api/v2/notifications/channels/{channelId}/subscriptions
channelId:
【request body】
The following topics for all users:
v2.users.{id}.activity
v2.users.{id}.conversations.calls
v2.users.{id}.presence
v2.users.{id}.routingStatus
【response body】
{}
・Question
Is it possible to receive the event via WebSocket when the user logs in or out?
"There isn’t a concept of “logged in” or “logged out” in PureCloud. Generally, you can consider the presence “Offline” to be when the user is not using PureCloud and any other presence means they are using PureCloud." Please, see this post
In your scenario, you could leverage the "v2.users.{id}.presence" topic and consider the user as:
-Logging in when the presence status changes from Offline to another state.
-And logging out when the presence status changes to Offline.
Note: the presence status will be changed to Offline when the users select "Logout" from Genesys Desktop, or when the user exits/closes the Genesys Desktop web page or client (the presence update occurs few seconds after the Genesys Desktop web app is closed).