更改正文内容后,AWS SQS 未保存事件,出现访问被拒绝错误

After Changing the Body content , AWS SQS is not saving the event and Error of access denied comes up

使用 Postman,我试图在 SQS 中保存一个事件,只需简单的 JSON 就可以正常工作,如下所示,

{
  "subscriptionId": "6d000ba7-9bcb-3e2f-bf2e-e960026f000e",
  "notificationId": 6,
  "id": "e8ee798d-c888-4fdd-666a-626627da0f73",
  "eventType": "workitem.created",
  "publisherId": "tfs"

}

但是当我在 JOSN 正文中添加以下 message:.. 内容时,它会出现 access Denied error in response in Postman(屏幕截图附在下面)。无法理解它拒绝的原因是什么,只是因为我在 body.

中更改了某些内容

-任何 pointers 如果我在这里遗漏了什么,请问?

{
  "subscriptionId": "6d000ba7-9bcb-4e2f-bf2e-e960046f000e",
  "notificationId": 6,
  "id": "e0ee798d-c888-4fdd-666a-976627da0f73",
  "eventType": "workitem.created",
  "publisherId": "tfs",
  "message": {
    "text": "Issue #17 (sdgdfsgfdg) created by Umair Ashraf\r\n(https://dev.azure.com/Umair0ashraf777/web/wi.aspx?pcguid=a6844a4c-f27f-428a-8051-342343b5fa34&id=19)",
    "html": "<a href=\"https://dev.azure.com/Umair0ashraf777/web/wi.aspx?pcguid=a6844a4c-f27f-428a-8051-342343b5fa34&amp;id=17\">Issue #17</a> (sdgdfsgfdg) created by Umair Ashraf",
    "markdown": "[Issue #17](https://dev.azure.com/Umaira0shraf777/web/wi.aspx?pcguid=a6844a4c-f27f-428a-8051-342343b5fa34&id=17) (sdgdfsgfdg) created by Umair Ashraf"
  }
}

我在Postman中的Body中添加消息及其值后出现以下错误,

APIGateway配置如下,将消息保存在SQS

编码问题!所以需要在将正文发送到 SQS 队列之前对其进行编码,如下所示,

所以我们需要转到 API 然后转到集成请求并设置映射模板如下,

Action= SendMessage&MessageBody= $util.urlENcode($input.body)

注意:在我使用之前没有像下面那样对正文进行编码并且只为简单的JSON工作......

Action= SendMessage&MessageBody=$input.body