admin管理员组文章数量:1202337
Below is the payload I am sending to the API Gateway where mapping templates are configured for returning response:
{
"changeType": "created",
"notificationUrl": ".1.1/ingestion",
"resource": "users/f5bc9f8b-d638-4da5-aa8b-a4d79350f33c/messages",
"expirationDateTime": "2025-01-23T07:23:45.9356913Z",
"clientState": "zxcvqqbnmm"
}
When I send this request, I receive the following error response:
{
"error": {
"code": "ValidationError",
"message": "The request is invalid due to validation error.",
"innerError": {
"date": "2025-01-22T07:06:40",
"request-id": "e50950bd-c1f8-483d-94c3-a3a6b8c6ab51",
"client-request-id": "e50950bd-c1f8-483d-94c3-a3a6b8c6ab51"
}
}
}
Mapping template configured as follows:
#set($token = $input.params('validationToken').trim())
#set($token = "$input.params('validationToken')")
#if($token.length() > 2)
#set($context.responseOverride.status = 200)
#set($context.responseOverride.content-type = "text/plain")
#set($context.requestOverride.path.body = "$token")
{
"headers": {
"Content-Type": "application/json"
},
"status": 200,
"body": {
"validationToken": "$token"
},
"StreamName": "notifications-ingestion-stream",
"Records": [
{
"Data": "$util.base64Encode($token)",
"PartitionKey": "token.token.token"
}
]
}
Response Template
#set($body = $context.requestOverride.path.body)
$body
I suspect the error might be due to the way the validationToken is handled or returned in the mapping template. Has anyone encountered this issue or have suggestions for debugging it?
Any help would be greatly appreciated!
本文标签:
版权声明:本文标题:amazon web services - I am trying to create a subscription in the Microsoft Graph API to monitor changes in user messages and ge 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738581444a2101186.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论