skip to Main Content

I have an AWS Connect Contact Flow… it invokes a Lambda Function as below:
enter image description here

Now, I’ve followed the docs and set my destination key aligned to the name of the parameter in my Lambda function.
enter image description here

But now matter what I try even setting a phone number manually… the flow sends an empty JSON object to my lambda function.

This is eating my lunch, anyone have a solution?

3

Answers


  1. Chosen as BEST ANSWER

    This issues is with the object being passed from AWS connect to the Lambda function. The custom json items are attached to the "Parameters" object on the "Details" object.


  2. Looks like you are not publishing your flow and you are retrying just by saving the flow.

    Login or Signup to reply.
  3. I think I have solved this. You need to create the same class structure for the Contact flow. What I create is below and I just added custom name under "Parameters" which is the "DialedNumber" and I have put the same name in the Function Input parameters in Invoke AWS Lambda Function under the "Destination Key" and to test I set the value to manually but it will depend on your logic. Then you need to put the class in your function as the 2nd image.

    1st Image in AWS Lambda Function input parameter
    2nd Image in c# Function

    public class Parameters
    {
        public string DialedNumber { get; set; }
    }
    public class ContactFlowModel
    {
        public string Name { get; set; }
        public Details Details { get; set; }
    }
    
    public class Attributes
    {
    }
    
    public class Audio
    {
        public string StartFragmentNumber { get; set; }
        public string StartTimestamp { get; set; }
        public string StreamARN { get; set; }
    }
    
    public class ContactData
    {
        public Attributes Attributes { get; set; }
        public string Channel { get; set; }
        public string ContactId { get; set; }
        public CustomerEndpoint CustomerEndpoint { get; set; }
        public string InitialContactId { get; set; }
        public string InitiationMethod { get; set; }
        public string InstanceARN { get; set; }
        public MediaStreams MediaStreams { get; set; }
        public string PreviousContactId { get; set; }
        public object Queue { get; set; }
        public SystemEndpoint SystemEndpoint { get; set; }
    }
    
    public class Customer
    {
        public Audio Audio { get; set; }
    }
    
    public class CustomerEndpoint
    {
        public string Address { get; set; }
        public string Type { get; set; }
    }
    
    public class Details
    {
        public ContactData ContactData { get; set; }
        public Parameters Parameters { get; set; }
    }
    
    public class MediaStreams
    {
        public Customer Customer { get; set; }
    }
       
    public class SystemEndpoint
    {
        public string Address { get; set; }
        public string Type { get; set; }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search