3
votes

I am creating a dialer to call patient's.

Once they answer it will ask them:

say: This is {our company name} calling to schedule an appointment. If this is {{INSERT FIRST & LAST NAME }} and you are available to scheduling your appointment please press 1

2 questions: 1) How can I pass the name to Twilio via REST API, I see I can pass the number easily to dial but how can I send the number and the name to say? 2) How do I insert the name into the studio flow? to use TTS to say their name in between generic audio?

1

1 Answers

3
votes

In addition to the mandatory parameters to and from you'll need to pass a third parameter named parameters which should be a JSON data as a string (key value pairs).

In your case, if you'd like to pass the full name as "Smith, John" then parameters={"full_name": "Smith, John"}.

With this, a widget in your Flow can reference the variable {{flow.data.full_name}}.


You can have more key/value pairs like: parameters={"first_name": "John", "last_name": "Smith"} and reference them as {{flow.data.first_name}} and {{flow.data.last_name}}.

You did not say in your question what language and library you use but if you use Twilio's Node.js library here is a link to Twilio's docs about this: (https://www.twilio.com/docs/studio/rest-api/execution?code-sample=code-create-an-execution-with-custom-parameters&code-language=Node.js&code-sdk-version=3.x)