Twitter Block

The Twitter block invokes Twitter APIs using the configured details.

Conditional Exits

The Twitter block has conditional exits to determine the action of the Voice application when the following events occur:

  • Twitter error - The Voice application is not able to send a Tweet/Direct Message (for example, error received from Twitter).
  • Timeout occurred – Timeout occurred during the execution of Twitter block. This can be used to perform other actions after a timeout. For instance, adding a log message to inform the user that a timeout has occurred.

Settings

The Twitter block has the following settings:

  • URL (required) - The resource URL of the Twitter API.
  • API Key (required) - Consumer Key (API Key) which can be obtained from Twitter App settings.
  • Shared Secret (required) - Consumer Secret (API Secret) which can be obtained from Twitter App settings.
  • Access Token (required) - This field can be obtained from Twitter App settings.
  • Token Secret (required) - It is the Access Token secret that can be obtained from the Twitter App Settings.
  • HTTP Method (required) - The GET or POST method of the HTTP request.
  • HTTP Headers - List of HTTP header and value pairs that will be sent in the HTTP message.
  • URL Parameters - List of URL parameters and corresponding values that will be sent as URL param in GET message. The list is also used to send the param list in the HTTP body when content type “application/x-www-form-urlencoded” is selected for POST method.
  • Content Type - The content type of the HTTP body can be selected from one of the following values:
    • application/x-www-form-urlencoded
    • application/json
  • HTTP Body – Text area to populate the content of the body that will be sent in HTTP message.
  • Property to store Tweet/Direct Message Content – Name of the interaction property that will be assigned with the content of “Message Content” field. This can be used to specify the Message content in HTTP Body field or URL Parameters.
  • Message Content – Text area to populate the actual tweet/message text that will be sent in the HTTP request. The number of characters remaining is displayed just below this field.

When configuration for this bock is complete, click the Update button to apply the settings.

Timeout Configuration

HTTP timeouts may be encountered while communicating with Twitter servers. The timeout could occur for various reasons including resolving the domain name, establishing a connection to the server, sending the data, or when receiving the response.

In the event of such timeout, Twitter block invokes a conditional exit, labeled “timeout occurred”. The network may return multiple error codes for the timeout.

The timeout error codes can be configured using the TimeOutErrCode element under the SaaS configuration. One common error code (-2147012894) for timeout is included by default.

Example:

<Integrations>

<SaaS Enable="true">

<Connections>

<Connection Comment="" FoundationSync="1" ………../>

<Timeouts>

<TimeOutErrCode>-2147012894 </TimeOutErrCode>

</Timeouts>

</Connection>

</Connections>

</SaaS>

</Integrations>