Jump to: navigation, search
(Example)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
=CometD notifications=
 
=CometD notifications=
__TOC__
+
__NOTOC__
 
You can subscribe to the '''/v2/me/facebooksession''' topic to receive [[AsynchronousEvents|CometD]] notifications for the Facebook Private Messaging API. This topic provides messages related to private Facebook messages, including changes to agent state, do-not-disturb, call forwarding, and supervisor monitoring. It supports the following message types:  
 
You can subscribe to the '''/v2/me/facebooksession''' topic to receive [[AsynchronousEvents|CometD]] notifications for the Facebook Private Messaging API. This topic provides messages related to private Facebook messages, including changes to agent state, do-not-disturb, call forwarding, and supervisor monitoring. It supports the following message types:  
 
*[[FacebookPMMessageType#FacebooksessionStateChangeMessage|FacebooksessionStateChangeMessage]]
 
*[[FacebookPMMessageType#FacebooksessionStateChangeMessage|FacebooksessionStateChangeMessage]]
Line 14: Line 14:
 
|-
 
|-
 
| data.messageType
 
| data.messageType
| This property identifies the message type.
+
| This property identifies the message type, in this case FacebooksessionStateChangeMessage.
 
|-
 
|-
 
| data.notificationType
 
| data.notificationType
 
| This property further identifies the type of notification and can have one of the following values:
 
| This property further identifies the type of notification and can have one of the following values:
{{Editgrn_open}}What are the possible values?{{Editgrn_close}}
+
*StatusChange — The status of the facebooksession interaction has changed.
 +
*ParticipantsUpdated — The facebooksession participants have changed.
 +
*PropertiesUpdated — The facebooksession data has changed.
 +
*Error — This is sent when an operation on the facebooksession resource fails.
 
|-
 
|-
 
| data.facebooksession
 
| data.facebooksession
Line 24: Line 27:
 
|-
 
|-
 
| data.referenceId
 
| data.referenceId
| {{Editgrn_open}}Missing description{{Editgrn_close}}
+
| The reference identifier is used to link the notification to the original request that created it.
 
|}
 
|}
  
Line 46: Line 49:
 
         ],
 
         ],
 
         "id":"0000Na9B26EF002X",
 
         "id":"0000Na9B26EF002X",
         "uri":"http://localhost:8080/api/v2/facebooksession/0000Na9B26EF002X",
+
         "uri":"http://localhost:8080/api/v2/facebooksessions/0000Na9B26EF002X",
 
         "participants":[   
 
         "participants":[   
  
Line 64: Line 67:
 
|-
 
|-
 
| data.messageType
 
| data.messageType
| This property identifies the message type.
+
| This property identifies the message type, in this case MessageLogUpdated.
 
|-
 
|-
 
| data.notificationType
 
| data.notificationType
| This property further identifies the type of notification and can have one of the following values:
+
| This property further identifies the type of notification and has a value of NewMessages.
{{Editgrn_open}}What are the possible values?{{Editgrn_close}}
 
 
|-
 
|-
 
| data.messages
 
| data.messages
Line 152: Line 154:
 
         }
 
         }
 
       ],
 
       ],
       "facebooksessionUri":"http://localhost:8080/api/v2/facebooksession/0000Na9B26EF002X"
+
       "facebooksessionUri":"http://localhost:8080/api/v2/facebooksessions/0000Na9B26EF002X"
 
   }
 
   }
 
}
 
}

Latest revision as of 05:54, January 17, 2019

CometD notifications

You can subscribe to the /v2/me/facebooksession topic to receive CometD notifications for the Facebook Private Messaging API. This topic provides messages related to private Facebook messages, including changes to agent state, do-not-disturb, call forwarding, and supervisor monitoring. It supports the following message types:

FacebooksessionStateChangeMessage

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 FacebooksessionStateChangeMessage.
data.notificationType This property further identifies the type of notification and can have one of the following values:
  • StatusChange — The status of the facebooksession interaction has changed.
  • ParticipantsUpdated — The facebooksession participants have changed.
  • PropertiesUpdated — The facebooksession data has changed.
  • Error — This is sent when an operation on the facebooksession resource fails.
data.facebooksession A facebooksession resource with the updated state and capabilities.
data.referenceId The reference identifier is used to link the notification to the original request that created it.

Example

{  
   "data":{  
      "messageType":"FacebooksessionStateChangeMessage",
      "referenceId":17,
      "notificationType":"StatusChange",
      "facebooksession":{  
         "state":"Chatting",
         "capabilities":[  
            "Transfer",
            "Complete",
            "Leave",
            "InFocus",
            "SendMessage",
            "SendStartTypingNotification",
            "SendStopTypingNotification"
         ],
         "id":"0000Na9B26EF002X",
         "uri":"http://localhost:8080/api/v2/facebooksessions/0000Na9B26EF002X",
         "participants":[  

         ]
      }
   }
}

MessageLogUpdated

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 MessageLogUpdated.
data.notificationType This property further identifies the type of notification and has a value of NewMessages.
data.messages A list of messages/notifications that were exchanged in private messages.
data.facebooksessionUri The location of the facebooksession resource.

Example

{  
   "data":{  
      "messageType":"MessageLogUpdated",
      "notificationType":"NewMessages",
      "messages":[  
         {  
            "index":1,
            "type":"ParticipantJoined",
            "from":{  
               "type":"Customer",
               "nickname":"PersonP",
               "participantId":"009052C5E6D6004A"
            },
            "visibility":"All",
            "timestamp":"2014-01-02T14:23:18.000-0800"
         },
         {  
            "index":2,
            "type":"ParticipantJoined",
            "from":{  
               "type":"Agent",
               "nickname":"Marat",
               "participantId":"009052C5E743004C"
            },
            "visibility":"All",
            "timestamp":"2014-01-02T14:23:18.109-0800"
         },
         {  
            "index":3,
            "type":"ParticipantLeft",
            "from":{  
               "type":"Agent",
               "nickname":"Marat",
               "participantId":"009052C5E743004C"
            },
            "visibility":"All",
            "timestamp":"2014-01-02T14:23:19.909-0800"
         },
         {  
            "index":4,
            "type":"TypingStarted",
            "from":{  
               "type":"Customer",
               "nickname":"PersonP",
               "participantId":"009052C5E6D6004A"
            },
            "visibility":"All",
            "timestamp":"2014-01-02T14:23:20.121-0800"
         },
         {  
            "index":5,
            "type":"Text",
            "from":{  
               "type":"Customer",
               "nickname":"PersonP",
               "participantId":"009052C5E6D6004A"
            },
            "text":"Hello World",
            "visibility":"All",
            "timestamp":"2014-01-02T14:23:20.126-0800"
         },
         {  
            "index":6,
            "type":"ParticipantJoined",
            "from":{  
               "type":"Agent",
               "nickname":"Marat",
               "participantId":"009052C5EF51004D"
            },
            "visibility":"All",
            "timestamp":"2014-01-02T14:23:20.171-0800"
         }
      ],
      "facebooksessionUri":"http://localhost:8080/api/v2/facebooksessions/0000Na9B26EF002X"
   }
}
This page was last edited on January 17, 2019, at 05:54.
Comments or questions about this documentation? Contact us for support!