如何使用Slack中的有效负载调用AWS Lambda

时间:2020-07-05 13:08:19

标签: amazon-web-services aws-lambda slack slack-api

我尝试通过aws聊天机器人为Slack调用lambda,如下所示:

@aws lambda invoke --function-name lambda-identifier --payload {"key":"val"}

但是失败了:

!Could not parse request body into json: Unexpected character ('“' (code 8220 / 0x201c)): was expecting double-quote to start field name
at [Source: (byte[])"{“key”:“val”}"; line: 1, column: 5] (Service: AWSLambda; Status Code: 400; Error Code: InvalidRequestContentException; Request ID: 13724903-b15f-48e6-bc1a-9c6f9386baf4; Proxy: null)

我认为发生这种情况是因为Slack将简单的引号"转换为优雅的引号。但是我不知道如何防止这种行为。

1 个答案:

答案 0 :(得分:1)

只需禁用该死的东西: enter image description here