Jump to: navigation, search

CometD notifications

You can subscribe to the /v2/me/im-sessions topic to receive CometD notifications for the IM Session API. This topic provides messages related to instant messaging between agents, including changes to IM session state and updates to IM session data. It supports the following message types:

IMSessionStateChangeMessage

Property Description
data The data element is present in all CometD notifications and is the root JSON element. You can use data.messageType to identify the message and determine what other properties should be present.
data.messageType This property identifies the message type, in this case IMSessionStateChangeMessage.
data.notificationType This property further identifies the type of notification and can have one of the following values:
  • StatusChange — The status of the IM session has changed.
  • AttachedDataChanged — The attached data for the IM session has changed.
data.imSession An IM session resource with the updated state and capabilities.

Example

{  
   "data":{  
      "messageType":"IMSessionStateChangeMessage",
      "notificationType":"StatusChange",
      "imSession":{  
         "state":" Talking",
         "userData":{  
            "favColor":"blue"
         },
         "id":"12398123091823091283012",
         "uri":"http://hpe-voicevm-64.genesyslab.com:8090/api/v2/im-sessions/00S4UMMDT8AHN1VL807GK2LAES000002",
         "path":"/im-sessions/12398123091823091283012",
         "participants":[  
            {  
               "digits":"3002",
               "e164Number":"3002",
               "formattedPhoneNumber":"3002",
               "phoneNumber":"3002"
            }
         ],
         "capabilities":[  
            "Complete",
            "AttachUserData",
            "DeleteUserData",
            "UpdateUserData",
            "SendMessage"
         ]
      }
   }
}

IMLogUpdateMessage

Property Description
data The data element is present in all CometD notifications and is the root JSON element. You can use data.messageType to identify the message and determine what other properties should be present.
data.messageType This property identifies the message type, in this case IMLogUpdateMessage.
data.notificationType This property further identifies the type of notification and can only have a value of NewMessage.
imSessionPath The path to the associated IM session resource.
message Contains a message newly added to the session.

Example

{  
   "data":{  
      "messageType":"IMLogUpdateMessage",
      "notificationType":"NewMessage",
      "imSessionPath":"/im-sessions/12398123091823091283012",
      "message":"Hello! This is my first message."
   }
}
This page was last edited on October 31, 2023, at 13:29.
Comments or questions about this documentation? Contact us for support!