简体   繁体   English

使用 Python 将属性从 AWS Connect 传递到 Lambda

[英]Passing attribute from AWS Connect to Lambda using Python

Stuck on a single step and doc searching isn't helping...停留在一个步骤并且文档搜索无济于事......

In Connect I have:在连接中,我有:

  1. Store customer input: "What's your age?"商店客户输入:“你几岁?”
  2. Set contact attribute: age -> system -> stored customer input设置联系人属性:年龄 -> 系统 -> 存储的客户输入

I know the above works because I've had a Play Prompt read back the attribute.我知道上述工作,因为我有一个播放提示读回属性。

I want Lambda to handle somethings with the age.我希望 Lambda 能够处理随着年龄的增长。 I setup a function, I attached it to the Connect instance.我设置了一个 function,我将它附加到 Connect 实例。 I added it to the flow with a simple value pair response and that works (the Play Prompt plays back the non-dynamic response from Lambda).我用一个简单的值对响应将它添加到流中并且有效(播放提示播放来自 Lambda 的非动态响应)。

When I try to make it dynamic breaks.当我尝试使其动态中断时。

My understanding is that I should be able to get to this attribute in Lambda by using the passed JSON.... so I'm doing this:我的理解是,我应该能够通过使用传递的 JSON 来获得 Lambda 中的这个属性......所以我这样做:

age = event["Details"]["ContactData"]["Attributes"]["age"]年龄 = 事件[“详细信息”][“联系人数据”][“属性”][“年龄”]

Connect starts saying it has trouble accessing the attribute and ends the call. Connect 开始说它无法访问该属性并结束呼叫。 What am I doing wrong?我究竟做错了什么? The rest of the Python code is fine because if I hard set age (age = 24) the code runs fine. Python 代码的 rest 很好,因为如果我硬设置年龄(年龄 = 24),代码运行正常。

There was nothing wrong my code as it pertains to the lambda / connect integration... it was with something that was just causing an error.我的代码没有任何问题,因为它与 lambda / 连接集成有关......它只是导致错误。 I started monitoring the function in cloudwatch and that helped!我开始在 cloudwatch 中监控 function,这很有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM