This example illustrates modifying a message sent through Programmable SMS which involves modifying the message-body from a message record while retaining the rest of the properties. We use the Twilio Modify Snap to achieve this result. To use this example you must have a valid Twilio Account (see Configure Twilio Accounts) and a Twilio phone number (including a trial phone number). You should also have sent at least one message with that Twilio phone number.
Download this pipeline.
-
Configure the Twilio Modify Snap with the following settings.
- API object: Programmable SMS
- Entity: Messages
- Entity SID:
$MessageSid
Note: In the Entity SID field you need to provide the message SID retrieved from your Twilio account (the one created from the Twilio Create Pipeline).
-
Configure the Mapper Snap upstream of the Twilio Modify Snap.
On validation, you can view both the required and optional parameters in the upstream Mapper Snap for updating the object of Messages entity in the Target Schema. Select the parameters that are dynamically populated from the JSON
Generator and map them to the Target Path.
-
Configure the JSON
Generator Snap.
Edit the JSON text in the JSON
Generator Snap according to Target path and provide them as expressions in the Mapper Snap.
To modify the message body, set the Body parameter as an empty string in the JSON object:
{
"MessageSid": "SM...",
"Body": ""
}
-
Add downstream Snaps to process the output.
-
Run the pipeline.
A successful execution of this Pipeline results in the following API response in the output view of the Twilio Modify Snap, which is then converted into XML format and streamed to the
File Writer
Snap. You can see the generated XML file in the project workspace.
To reuse this pipeline in your environment:
- Download and import the Pipeline into SnapLogic.
- Configure Snap accounts as applicable.
- Update the
MessageSid parameter with a valid message SID from your Twilio account.
- Customize the
Body parameter with your desired message modification.