CometD notifications
You can subscribe to the /v2/me/twitter topic to receive CometD notifications for the Twitter API. This topic provides messages related to Twitter interactions, including changes Twitter interaction state, updates to Twitter interaction data, and updates to Twitter account following. It supports the following message types:
TweetStateChangeMessage
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 TweetStateChangeMessage. |
data.notificationType | This property further identifies the type of notification and can have one of the following values:
|
data.tweet | A twitter 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":"TweetStateChangeMessage",
"notificationType":"StatusChange",
"referenceId":139,
"tweet":{
"capabilities":[
"Reply",
"Retweet",
"Transfer",
"AddComment",
"AttachUserData",
"UpdateUserData",
"DeleteUserData",
"SetDisposition",
"SetInFocus",
"Complete",
"MarkFavorite",
"RemoveFavorite"
],
"contactId":"0000Ka96XNNU4488",
"from":"vitaliy_onv(Oleg Witcher)",
"id":"01QN0QJNKK73600V",
"message":"On 12:58:9 11/5/2013, P created a post saying hello world!.",
"receivedDate":"2015-07-10 13:26:58.000+0300",
"revelantResponseTemplateGroups":[
],
"state":"Processing",
"subject":"On 12:58:9 11/5/2013, P created a pos...",
"suggestedQueueUris":[
],
"tweetType":"Inbound",
"twitterCreatedAt":"2013-11-05T10:58:12Z",
"twitterFromAddr":"vitaliy_onv",
"twitterFromUserId":"2175525290",
"twitterIsFavorited":"false",
"twitterIsRetweet":"false",
"twitterMsgId":"85262302",
"twitterMsgPlainText":"On 12:58:9 11/5/2013, P created a post saying hello world!.",
"twitterMsgType":"Status",
"twitterQueryName":"stream-user",
"twitterRetweetCount":"0",
"twitterSource":"<a href=" http://www.kaermorhen.ru" rel="nofollow">Witcher_APP</a>",
"twitterToAddr":"vitaliy_onv",
"twitterUserCreatedAt":"2013-11-05T06:56:43Z",
"twitterUserFollowersCount":"0",
"twitterUserFriendsCount":"0",
"twitterUserId":"2175525290",
"twitterUserImageURL":"http://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
"twitterUserIsFollower":"false",
"twitterUserIsFriend":"false",
"twitterUserLanguage":"r",
"twitterUserName":"Oleg Witcher",
"twitterUserScreenName":"vitaliy_onv",
"twitterUserStatusesCount":"2",
"twitterUserUtcOffset":"-1",
"uri":"http://192.168.83.25:8090/api/v2/tweet/01QN0QJNKK73600V",
"userData":{
"CBR-IT-path_DBIDs":"",
"CBR-Interaction_cost":"",
"CBR-actual_volume":"",
"CBR-contract_DBIDs":"",
"ClassifiedAndScreened":"1",
"Classify_Actionability_CtgId":"",
"Classify_Actionability_CtgName":"",
"Classify_Actionability_CtgRelevancy":"",
"Classify_Sentiment_CtgId":"",
"Classify_Sentiment_CtgName":"",
"Classify_Sentiment_CtgRelevancy":"",
"ContactCreated":"false",
"ContactId":"0000Ka96XNNU4488",
"ContactIdList":"0000Ka96XNNU4488",
"CustomerSegment":"default",
"FirstName":"Oleg",
"FromAddress":"vitaliy_onv(Oleg Witcher)",
"IxnAlreadyCreatedInUCS":"1",
"KloutId":"",
"LastName":"Witcher",
"NumberOfContactsFound":"1",
"PegAGSocial Media Agent Group":1,
"RRequestedSkillCombination":"",
"RRequestedSkills":None,
"RStrategyDBID":"985",
"RStrategyName":"Twitter Agent Delivery Strategy",
"RTargetAgentGroup":"Social Media Agent Group",
"RTargetAgentSelected":"a1",
"RTargetObjSelDBID":"117",
"RTargetObjectSelected":"Social Media Agent Group",
"RTargetPlaceSelected":"a1",
"RTargetRequested":"Social Media Agent Group",
"RTargetRuleSelected":"",
"RTargetTypeSelected":"2",
"RTenant":"Environment",
"RVQDBID":"",
"RVQID":"",
"RouterData70":"(" t"="1383649092 0")",
"Screen_Actionability_CtgName":"",
"Screen_Actionability_CtgRelevancy":"",
"Screen_Actionability_ScreenRuleName":"",
"Screen_Sentiment_CtgName":"",
"Screen_Sentiment_CtgRelevancy":"",
"Screen_Sentiment_ScreenRuleName":"",
"ServiceObjective":0,
"ServiceType":"default",
"Subject":"On 12:58:9 11/5/2013, P created a pos...",
"_umsChannel":"channel-twitter",
"_umsChannelInfo":{
"_twitterSourceNickName":"Twitter Application SmServer-1",
"_twitterUserId":"2175525290",
"_twitterUserImageURL":"http://abs.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
"_twitterUserName":"Oleg Witcher",
"_twitterUserScreenName":"vitaliy_onv"
},
"_umsChatPossible":"false",
"_umsFromAddr":"vitaliy_onv",
"_umsInboundIxnSubmittedBy":"Cloud_localhost",
"_umsMediaAccount":"2175525290",
"_umsMediaType":"twitter",
"_umsMsgPlainText":"On 12:58:9 11/5/2013, P created a post saying hello world!.",
"_umsRequestId":"14",
"desktop_actionable":"1",
"desktop_expand":"1",
"desktop_sentiment":"Neutral"
}
}
}
}
TweetOperationResponse
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 TweetOperationResponse. |
data.success | Specifies whether the tweet operation was successful. The possible values are true or false. |
data.errorMessage | If the success property has a value of false, then the notification will contain the errorMessage property with details about the error. |
data.referenceId | The reference identifier is used to link the notification to the original request that created it. |
Example
Success
{
"data":{
"messageType":"TweetOperationResponse",
"referenceId":1,
"success":"true"
}
}
Failure
{
"data":{
"messageType":"TweetOperationResponse",
"referenceId":1,
"success":"false",
"errorMessage":"Unable to perform twitter operation"
}
}
This page was last edited on March 25, 2016, at 18:23.
Comments or questions about this documentation? Contact us for support!