0

I want to setup a simple Amazon Connect call-flow that dials back any customer who leaves behind a phone number on my website. I am a rank beginner at Amazon Connect and cannot find any example code showing how to setup outbound calling to dynamically supplied phone numbers via a web-client.

Can someone point me to any example code. I have seen documentation of AWS Connect APIs including those for StartOutboundCall etc but am looking for some example code if possible.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Deepam
  • 19
  • 3

1 Answers1

2

https://blogs.perficient.com/2018/11/19/ac-outbound-api/ has a good example, that I've followed successfully.

The call is:

let params = {
    "InstanceId" : '12345l-abcd-1234-abcde-123456789bcde',
    "ContactFlowId" : '987654-lkjhgf-9875-abcde-poiuyt0987645',
    "SourcePhoneNumber" : '+1xxxxxxxxx',
    "DestinationPhoneNumber" : customerPhoneNumber,
    "Attributes" : {
        'name' : customerName,
        'dayOfWeek' : dayOfWeek
    }
}
let connect = new AWS.Connect();
connect.startOutboundVoiceContact(params, function (error, response) { ... });

Given a contact flow (of type "Contact Flow"), with arn: arn:aws:connect:us-east-1:xxxxxxxx:instance/12345l-abcd-1234-abcde-123456789bcde/contact-flow/987654-lkjhgf-9875-abcde-poiuyt0987645

The SourcePhoneNumber is required and must be one of those in your Amazon Connect. Or use a queue number if you have any defined.

The Attributes property will be passed as-is and will be available in text-to-speech, in your Contact Flow, with a form similar to $.Attributes.dayOfWeek.

The Contact Flow can be as simple as one Start, connected to one 'Play Prompt', connected to 'Disconnect/Hang up'.

All props go to https://blogs.perficient.com/author/dhodanic/