Jump to: navigation, search
(Update with the copy of version: 8.5.2DRAFT)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
=Send=
 
=Send=
 
__NOTOC__
 
__NOTOC__
 +
This operation is part of the [[Twitter|Twitter API]] section of the [[Welcome|Web Services API]].
 +
==Overview==
 +
Sends a Tweet to the specified Twitter account.
 +
{|
 +
! Request URL
 +
| /api/v2/me/tweets/{id}
 +
|-
 +
! HTTP Method
 +
| POST
 +
|-
 +
! Required Features
 +
| api-multimedia
 +
|}
  
This operation is used to send agent created data to the Twitter API for publishing.
+
==Parameters==
 +
{|
 +
! Parameter
 +
! Value
 +
|-
 +
| operationName
 +
| Send
 +
|-
 +
| queuePath
 +
| The job queue for handling the send operation. (required)
 +
|-
 +
| twitter
 +
| Specified data with Twitter parameters. (required)
 +
|-
 +
| saveLAR
 +
| Possible values are true or false. If true, information about the agent performing the operation is set in the Contact Profile so that it can be used for last agent routing. (optional)
 +
|}
 +
===Twitter Parameters===
 +
{|
 +
! Parameter
 +
! Value
 +
|-
 +
| from
 +
| A user name for a Twitter account.
 +
|-
 +
| message
 +
| The actual message to send. The body should be plain text.
 +
|}
  
== HTTP Request ==
+
==Samples==
POST on '''/me/interactions/{id}'''
+
===Request===
<pre>
+
<source lang="text">
{
+
POST api/v2/me/tweets/01QQQG2MU214P06D
"operationName":"Send",
+
{
"queueName": name of the queue where to place outbound Twitter interactions,
+
  "queuePath":"/contacts/60ebbb94-3cef-4b14-95f8-5c49dbeb355d",
"replyText": user generated text,
+
  "twitter":{ 
"monitorKey": name of the Twitter monitor chosen by the User during create posts
+
      "message":"HelloTwitter!",
 +
      "from":"vitaliy_onv"
 +
  },
 +
  "operationName":"Send"
 
}
 
}
</pre>
+
</source>
== HTTP Response ==
 
  
===Success===
+
===HTTP Response===
<pre>
+
<source lang="text">
 
{
 
{
"statusCode": 0
+
  "statusCode": 0,
 +
  "referenceId": 57
 
}
 
}
</pre>
+
</source>
===Failure===
+
 
<pre>
+
===CometD Response===
{
+
<source lang="text">
"statusCode": an integer value above 0,
+
{
"statusMessage":details
+
  "messageType":"TwitterStateChangeMessage",
 +
  "notificationType":"StatusChange",
 +
  "referenceId":57,
 +
  "twitter":{ 
 +
      "capabilities":[ 
 +
 
 +
      ],
 +
      "contactId":"00025aA4V4DR01M6",
 +
      "from":"vitaliy_onv",
 +
      "id":"01QQQG2MU214P06D",
 +
      "message":"Hello Twitter!",
 +
      "state":"Sent",
 +
      "subject":"Hello Twitter!",
 +
      "twitterType":"Outbound",
 +
      "uri":"http://192.168.83.25:8080/api/v2/tweet/01QQQG2MU214P06D",
 +
      "userData":{ 
 +
        "FromAddress":"vitaliy_onv",
 +
        "_twitterContactIsFollower":"false",
 +
        "_twitterContactIsFriend":"false",
 +
        "_twitterMsgType":"Status",
 +
        "_twitterUserId":"1258948171",
 +
        "_twitterUserImageURL":"http://pbs.twimg.com/profile_images/3366120480/a4a096e738b7111166a23dfe72613839_normal.png",
 +
        "_twitterUserName":"Vitaliy",
 +
        "_twitterUserScreenName":"vitaliy_onv",
 +
        "_umsChannel":"channel-twitter",
 +
        "_umsInboundIxnSubmittedBy":"esv_smsrv_vit",
 +
        "_umsMediaAccount":"1258948171"
 +
      }
 +
  }
 
}
 
}
</pre>
+
</source>
For details on the statusCode value, please refer to the All Methods sub-section of the Return Values section.
 
  
 
[[Category:V:HTCC:8.5.2]]
 
[[Category:V:HTCC:8.5.2]]

Latest revision as of 09:42, June 24, 2020

Send

This operation is part of the Twitter API section of the Web Services API.

Overview

Sends a Tweet to the specified Twitter account.

Request URL /api/v2/me/tweets/{id}
HTTP Method POST
Required Features api-multimedia

Parameters

Parameter Value
operationName Send
queuePath The job queue for handling the send operation. (required)
twitter Specified data with Twitter parameters. (required)
saveLAR Possible values are true or false. If true, information about the agent performing the operation is set in the Contact Profile so that it can be used for last agent routing. (optional)

Twitter Parameters

Parameter Value
from A user name for a Twitter account.
message The actual message to send. The body should be plain text.

Samples

Request

POST api/v2/me/tweets/01QQQG2MU214P06D
{  
   "queuePath":"/contacts/60ebbb94-3cef-4b14-95f8-5c49dbeb355d",
   "twitter":{  
      "message":"HelloTwitter!",
      "from":"vitaliy_onv"
   },
   "operationName":"Send"
}

HTTP Response

{
  "statusCode": 0,
  "referenceId": 57
}

CometD Response

{  
   "messageType":"TwitterStateChangeMessage",
   "notificationType":"StatusChange",
   "referenceId":57,
   "twitter":{  
      "capabilities":[  

      ],
      "contactId":"00025aA4V4DR01M6",
      "from":"vitaliy_onv",
      "id":"01QQQG2MU214P06D",
      "message":"Hello Twitter!",
      "state":"Sent",
      "subject":"Hello Twitter!",
      "twitterType":"Outbound",
      "uri":"http://192.168.83.25:8080/api/v2/tweet/01QQQG2MU214P06D",
      "userData":{  
         "FromAddress":"vitaliy_onv",
         "_twitterContactIsFollower":"false",
         "_twitterContactIsFriend":"false",
         "_twitterMsgType":"Status",
         "_twitterUserId":"1258948171",
         "_twitterUserImageURL":"http://pbs.twimg.com/profile_images/3366120480/a4a096e738b7111166a23dfe72613839_normal.png",
         "_twitterUserName":"Vitaliy",
         "_twitterUserScreenName":"vitaliy_onv",
         "_umsChannel":"channel-twitter",
         "_umsInboundIxnSubmittedBy":"esv_smsrv_vit",
         "_umsMediaAccount":"1258948171"
      }
   }
}
This page was last edited on June 24, 2020, at 09:42.
Comments or questions about this documentation? Contact us for support!