0
votes

I'm trying to call a Contact Flow using AWS Node.js SDK, but when I call startOutboundVoiceContact function always I get the following error:

Error: ContactFlow type is invalid

Follow bellow the code I'm trying to execute:

var connect = new AWS.Connect(credentials);

const uuidv1 = require('uuid/v1');

var params = {
    ContactFlowId: '............8af7-06898b1cd530', /* required */
    DestinationPhoneNumber: '+55319.....375', /* required */
    InstanceId: '........4c6c-aef3-5e4d8744580c', /* required */
    Attributes: {},
    ClientToken: uuidv1(),
    QueueId: '',
    SourcePhoneNumber: '+1800.....69'
};
connect.startOutboundVoiceContact(params, function (err, data) {
    if (err) 
        console.log(err, err.stack); // an error occurred
    else 
        console.log(data);           // successful response
});

code:"InvalidParameterException" message:"ContactFlow type is invalid" name:"InvalidParameterException" requestId:"65ce71bf-5bb4-11e9-bba3-fd537199b3ea" retryable:false retryDelay:14.721126612979884 stack:"InvalidParameterException: ContactFlow type is invalid\n at Object.extractError (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\protocol\json.js:51:27)\n at Request.extractError (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\protocol\rest_json.js:52:8)\n at Request.callListeners (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\sequential_executor.js:106:20)\n at Request.emit (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\sequential_executor.js:78:10)\n at Request.emit (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\request.js:683:14)\n at Request.transition (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\request.js:22:10)\n at AcceptorStateMachine.runTo (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\state_machine.js:14:12)\n at C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\state_machine.js:26:10\n at Request. (C:\Users\vs35\AppData\Roaming\npm\node_modules\aws-sdk\lib\request.js:38:... statusCode:400

Thanks for all help!

1

1 Answers

4
votes

You are most likely receiving this error because the Contact flow reference by the GUID in your API call is not a type of Contact Flow that can be used to initiate an outbound contact.

For example: if the GUID supplied to in the API call references a Contact Flow of type “outbound whisper”, the API call will fall in this manner.

An easy way to check this is to make sure you are referencing the GUID of a Contact Flow that can be assigned to an inbound number in the Connect GUI. If you can assign an inbound number to trigger the Contact Flow, then you should it able to use it in the the outbound API call.

An explanation of Contact Flow types can be found here.