Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents
maxLevel2
absoluteUrltrue

Overview

Use this Snap to create data objects in Twilio.
Image Modified

Prerequisites

  • Valid Twilio Account SID
  • Auth Token corresponding to the Account SID

...

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input 

Document


  • Min:1
  • Max:1
  • Mapper Snap
  • Copy Snap
  • CSV Parser
  • JSON Parser
A document containing details of the entity or data object to create a Twilio entity.
Output

Document


  • Min:0
  • Max:1
  • Mapper Snap
  • Copy Snap
  • XML Formatter
  • JSON Formatter

A document containing details indicating whether the create operation is successful.

Snap Settings

Parameter NameData TypeDescriptionDefault ValueExample 
LabelString

Insert excerpt
File Writer
File Writer
nopaneltrue

N/ATwilio Create
API objectString/Expression

Required. Select the API that you want to access in Twilio instance. This drop-down contains APIs (set of business objects) defined by Twilio.

Programmable SMSAutopilot
EntityString/Expression/SuggestionRequired. Select an entity that belongs to the corresponding API object chosen above, (the resources to retrieve for the selected API object).
For example,
Messages entity belongs to the Programmable SMS API object. In this field, the available entities are dynamically populated in the suggestion drop-down list based on the selected API object. 
MessagesAssistant
Required SIDs

Use this field set to define the parent entity String Identifiers (SIDs) necessary for accessing the requested resources, if any.

Info

Twilio's API designs follow a hierarchical pattern to indicate relationships among entities. For example, you can build an autopilot assistant to answer incoming calls with a task model. In this case, the 'Task' entity is considered as a property of 'Assistant' entity. Each 'Assistant' is instantiated with a SID, and one assistant can have many tasks with it. To retrieve the record for one of the tasks, you must provide the task's parent assistant SID in the Require SIDs table.


SID name

String/Expression/SuggestionSpecify the name of the parent SIDs of the input Entity
The available entities are dynamically populated in the suggestion list according to the specified 
Entity.   
NoneAssistantSid

SID value

StringSpecify the SID value for the corresponding SID name chosen above.NoneUA12ab387lbn432nbvl987fde9as349
Connection detailsUse this field set to configure the network connection parameters. This field set contains the following fields:
  • Connection timeout
  • Maximum request attempts
  • Retry request interval

Connection timeout

IntegerRequired. Specify the connection timeout duration in seconds.3060

Maximum request attempts

IntegerRequired. Specify the maximum number of connection attempts if the connection fails or is timed-out.06

Retry request interval

IntegerRequired. Specify the time in seconds to wait before retrying the connection request.
03
Snap ExecutionDropdown list

Select one of the three following modes in which the Snap executes:

  • Validate & Execute. Performs limited execution of the Snap and generates a data preview during Pipeline validation, then performs full execution of the Snap (unlimited records) during Pipeline runtime.
  • Execute only. Performs full execution of the Snap during Pipeline execution without generating preview data.
  • Disabled. Disables the Snap and all Snaps downstream from it.

Execute OnlyValidate & Execute

...

ErrorReasonResolution

The input entity does not exist.

An invalid entity has been entered.

Select a valid entity from the suggestion drop-down list.
One or more Required SIDs are missing. 

The Required SIDs are mandatory for this Endpoint.

Check your settings under the Required SIDs table and provide values accordingly.
You have an empty value in the SID name/value field for the Required SID.The SID name/value field must not be empty for Required SIDs.Enter a valid SID name/value for Required SID.


Input schema

The input schema for Twilio Create Snap should be routed to the Payload node. The Payload schema enables you to define the input payload for the API call when using the Twilio Create Snap. It dynamically loads and represents all the parameters that you need for the data object creation. If you have a Mapper Snap or a Snap which can display the entire input schema, always use Payload schema to define your input payload. Else, in your input JSON object, always include Payload text as a key in the parent of your input. 

...

Creating and Sending Messages using Twilio Programmable SMS Service

In this example, we want to create a Twilio message and send it to the target phone number. To use this example, you must have a valid and authorized Twilio Account (see Twilo Account for more information). You must also have a Twilio phone number with sufficient balance for sending at least one message.
Image Modified

First, we configure the Twilio Create Snap as shown below:
Image Modified

Then, we use a Mapper Snap upstream of Twilio Read Snap to map the parameters. On validation, we can view both the required and optional parameters for creating an object of Messages entity in the Target Schema of the upstream Mapper Snap.  We select the parameters that are dynamically populated from the JSON Generator and map them to the Target Path.

Image Modified

Subsequently, we edit the JSON text in the JSON Generator according to Target path and enter them as expressions in the Mapper Snap. The To parameter refers to the target phone number for receiving the message indicated under the Body parameter. The value for the From parameter must be a legal Twilio phone number

Image Modified

Upon successful execution the Pipeline results in the following API response in the output view of the Twilio Create Snap, which we later convert into XML and stream to an XML Writer Snap. In the interim, the target phone number receives the message from the Twilio phone number

Download this Pipeline

Downloads

...

Insert excerpt
Twilio Snap Pack
Twilio Snap Pack
nopaneltrue

...

See Also

...

...