Autodesk forge Webhook API,错误 400 400,VALIDATION_ERROR

Autodesk forge Webhook API, Error 400 400, VALIDATION_ERROR

使用 autodesk forge API,我正在尝试使用以下信息在文件夹上创建一个 webhook;不幸的是,我收到了以下回复:

{
   "id":"xxxx-xxxx-xxx-xxxxx",
   "status":400,
   "code":"VALIDATION_ERROR",
   "detail":["Payload is not valid for serialization"]
}

URL: https://developer.api.autodesk.com/webhooks/v1/systems/data/events/dm.folder.added/hooks (for specific folder added event) or: https://developer.api.autodesk.com/webhooks/v1/systems/data/hooks(对于所有事件)。两者都返回相同的错误

Header:

{
"Content-Type":"application/json",
   "Authorization":"<MY_TOKEN>",
   "x-ads-region":"US"
}

数据:

{
   "callbackUrl":"<MY_DOMAIN>:<MY_PORT>/callback",
   "scope":{
      "folder":"urn:adsk.wipprod:fs.folder:co.xxxxxxxxxxxx-xxxxx"
   }
}

疑难解答:

任何 suggestion/help?

回答我自己:)

我发现我的问题与 Forge API 无关,它是与 python 请求相关的一般问题。 Requests的payload(数据)不能是嵌套字典,只接受一级字典,嵌套会失败。解决方案是对字典进行字符串化 (json.dumps) 并将该字符串用作请求负载。