Using a Twilio account with PingOne to support Twilio Studio flows
To use Twilio studio flows, configure Twilio as a custom provider and then define the specific flows that you want to use. You’ll also need to configure the relevant PingOne notifications for use with the relevant Twilio flow.
Steps
-
Go to Settings > Sender.
-
Select SMS/Voice.
-
Select Custom Provider.
Selecting Custom Provider deletes any existing custom server configuration, if one exists.
-
Provider Name: Enter a meaningful name for your Twilio provider account.
-
Authorization: Select Basic and then enter
-
User Name: Enter the Twilio Studio account
sid
as your username. -
Password: Enter the Twilio Studio account token as your password.
When editing an existing configuration, you can click Change Account to enter a new password for the custom provider account.
-
-
Origination: Click Add Sender Phone Number to configure a sender phone number, and for each number entered, select the following:
-
Type: Select the type of phone number
-
Standard: The sender Number must conform to the valid format of a full international phone number.
-
Toll-free: The sender Number should be a valid toll-free phone number (US only). It is the customer’s responsibility to confirm that the number is toll-free.
-
Short code: The sender Number must conform to the valid format of a short code phone number (US only). It is the customer’s responsibility to confirm that the number is a short code.
-
-
Select at least one of the SMS or Voice checkboxes to define which device type is directed to the studio flow.
The studio flow defines the actual method that will be used to send the OTP (SMS, Voice, or other).
-
-
SMS:
To direct SMS devices to the Twilio Studio flow, configure this section.
-
Type: Select the POST operation to issue a POST request to the Twilio REST API.
-
URL: Enter the full URL for the Twilio Studio flow you want to use:
https://studio.twilio.com/v2/Flows/<flowID>/Executions
-
Body: The request body format style for configuration maintenance. In the list, select Form and then add the following key and value pairs. Click Add Key, Value for each additional entry.
Key Value From
${from}
to
${to}
Parameter
${message}
This takes the notification value defined in Experiences → Notifications. The message text is defined in the last step of this procedure.
When saving, be aware that changing the request body’s format style from Form deletes the request body’s key and value pairs, and changing the format style from Raw deletes the request body’s free-form JSON text.
-
-
Voice:
To use Twilio studio to send voice messages, configure this section.
-
Type: Select the POST operation to issue voice notification requests to the associated vendor URL endpoint.
-
URL: Enter the following URL, including the flow ID for the Voice communication flow from Twilio studio:
https://studio.twilio.com/v2/Flows/<flowID>/Executions
-
Body: The request body format style for configuration maintenance. In the list select Form and then add the following key and value pairs. Click Add Key, Value for each additional entry.
Key Value From
${from}
To
${to}
Parameters
${message}
This takes the notification value defined in Experiences → Notifications. The message text is defined in the last step of this procedure.
When saving, be aware that changing the request body’s format style from Form deletes the request body’s key and value pairs, and changing the format style from Raw deletes the request body’s free-form JSON text.
-
-
Click Save.
-
Go to User Experience > Notification Templates and for each notification type that you want to use with Twilio Studio:
-
Right-click theMore options icon and select Edit.
-
In the New Message field for the relevant authentication method, enter
\{"OTP":${otp}}
You can include additional parameters, such as username in the message. For example:
{"OTP":${otp}, "username":${username}}
You can also use dynamic variables in the Body section. For more information, see Dynamic variables in the PingOne Platform API Reference.
-
-
Check your configuration:
-
To check SMS configuration, in the SMS area, click Send Test SMS and in the modal, enter a destination phone number to test receiving an SMS notification from Telesign, and then click Send. A test SMS notification should be received on the destination phone.
-
To check Voice configuration, in the Voice area, click Send Test Voice and in the modal, enter a destination phone number to send a Voice notification from Telesign, and then click Send. A test voice notification should be received on the destination phone.
-