Search code examples
amazon-web-servicesaws-lambdaslackslack-api

How to invoke aws lambda with payload from Slack


I attempt invoking lambda through the aws chatbot for Slack like so:

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

but it fails with:

!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)

I suppose this happens because Slack converts the simple quotes " to the elegant ones: . But I don't know how can I prevent this behavior.


Solution

  • Just needed to disable this damn thing: enter image description here