Jump to: navigation, search

CometD notifications

You can subscribe to the /v2/ucs/interactions topic to receive CometD notifications for the Interaction History API. This topic provides messages related to interaction history. It supports the following message types:

GetInteractionsHistoryMessage

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 GetInteractionsHistoryMessage.
data.interaction An interaction history resource.
data.referenceId The reference identifier is used to link the notification to the original request that created it.
data.errorMessage If the operation doesn't succeed, then the notification contains the errorMessage property with details about the error.

Example

Success

{  
   "data":{  
      "referenceId":1,
      "messageType":"GetInteractionsHistoryMessage",
      "interactions":[  
         {  
            "typeId":"Inbound",
            "startDate":"2015-10-01 16:02:07.000+0300",
            "endDate":"2015-10-01 16:02:10.000+0300",
            "mediaType":"Chat",
            "uri":"http://localhost:8080/api/v2/interactions/00016aB14RQD003N",
            "state":"InProcess",
            "contactId":"00012aB0T770000M",
            "id":"00016aB14RQD003N",
            "subject":"Customer support",
            "customAttributes":{  
               "SearchId":"123456",
               "CustomerId":"a21d4c3"
            }
         },
         {  
            "typeId":"Inbound",
            "startDate":"2015-10-02 20:02:07.000+0300",
            "ownerInformation":{  
               "userName":"a2",
               "lastName":"a2",
               "id":"cc9016eee9c84dfeb266c642d9fd92c5",
               "firstName":"a2"
            },
            "mediaType":"Chat",
            "uri":"http://localhost:8080/api/v2/interactions/00016aB14RQD003K",
            "state":"InProcess",
            "contactId":"00012aB0T770000M",
            "id":"00016aB14RQD003K",
            "subject":"Customer support",
            "customAttributes":{  
               "SearchId":"123456"
            }
         },
         {  
            "typeId":"Inbound",
            "startDate":"2015-10-03 14:02:07.000+0300",
            "endDate":"2015-10-03 14:02:25.000+0300",
            "ownerInformation":{  
               "userName":"a1",
               "lastName":"a1",
               "id":"e6f2ad1b26ea4e9b8dd907eabe167522",
               "firstName":"a1"
            },
            "mediaType":"Chat",
            "uri":"http://localhost:8080/api/v2/interactions/00012aB0T770000K",
            "state":"Stopped",
            "contactId":"00012aB0T770000M",
            "id":"00012aB0T770000K",
            "subject":"qq",
            "customAttributes":{  
               "SearchId":"123456"
            }
         }
      ]
   }
}

Failure

{  
   "data":{  
      "referenceId":1,
      "messageType":"GetInteractionsHistoryMessage",
      "errorMessage":"Request failed"
   }
}

GetInteractionContentMessage

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 GetInteractionContentMessage.
data.interaction An interaction history resource.
data.messages A list of message resources. This property is only included for Chat or FacebookSession interactions.
data.referenceId The reference identifier is used to link the notification to the original request that created it.
data.errorMessage If the operation doesn't succeed, then the notification contains the errorMessage property with details about the error.

Example

Success

{  
   "data":{  
      "referenceId":2,
      "messageType":"GetInteractionContentMessage",
      "interaction":{  
         "uri":"http://localhost:8080/api/v2/interactions/0000Sa99620J0EM5",
         "id":"0000Sa99620J0EM5",
         "path":"/interactions/0000Sa99620J0EM5",
         "mediaType":"facebooksession",
         "typeId":"Inbound",
         "state":"Stopped",
         "startDate":"2013-11-25 21:02:22.000+0200",
         "endDate":"2013-11-25 21:02:25.000+0200",
         "subject":"Customer support",
         "contactId":"0000Sa99620J0EM7",
         "ownerInformation":{  
            "userName":"a2",
            "lastName":"a2",
            "id":"cc9016eee9c84dfeb266c642d9fd92c5",
            "firstName":"a2"
         }
      },
      "messages":[  
         {  
            "index":1,
            "from":{  
               "nickname":"You",
               "type":"Customer",
               "participantId":"00AF52939EBE5BC4"
            },
            "timestamp":"2013-11-2521: 02: 22.000+0200",
            "visibility":"All",
            "type":"ParticipantJoined",
            "timestampSeconds":1385406142000L
         },
         {  
            "index":2,
            "from":{  
               "nickname":"GWS1",
               "type":"Agent",
               "participantId":"00AF52939EDF5BC6"
            },
            "timestamp":"2013-11-2521: 02: 22.033+0200",
            "visibility":"All",
            "type":"ParticipantJoined",
            "timestampSeconds":1385406142033L
         },
         {  
            "index":3,
            "from":{  
               "nickname":"GWS1",
               "type":"Agent",
               "participantId":"00AF52939EDF5BC6"
            },
            "text":"Hello!",
            "visibility":"All",
            "timestamp":"2013-11-2521: 02: 22.036+0200",
            "type":"Text",
            "timestampSeconds":1385406142036L
         },
         {  
            "index":13,
            "from":{  
               "nickname":"GWS1",
               "type":"Agent",
               "participantId":"00AF52939EDF5BC6"
            },
            "timestamp":"2013-11-2521: 02: 22.054+0200",
            "visibility":"All",
            "type":"ParticipantLeft",
            "timestampSeconds":1385406142054L
         },
         {  
            "index":14,
            "from":{  
               "nickname":"You",
               "type":"Customer",
               "participantId":"00AF52939EBE5BC4"
            },
            "timestamp":"2013-11-2521: 02: 22.054+0200",
            "visibility":"All",
            "type":"ParticipantLeft",
            "timestampSeconds":1385406142054L
         }
      ]
   }
}

Failure

{  
   "data":{  
      "referenceId":1,
      "messageType":"GetInteractionContentMessage",
      "errorMessage":"Request failed"
   }
}
This page was last edited on February 15, 2024, at 19:11.
Comments or questions about this documentation? Contact us for support!