You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Microsoft Graph API更新Booking Appointment的customQuestionAnswers失败求助

正确更新Booking Appointment的customQuestionAnswers的方式

你遇到的错误是因为请求体中包含了customQuestionAnswers的只读属性。question、answerOptions、isRequired、answerInputType这些字段属于自定义问题的定义属性,是只读的,更新答案时不需要提交这些内容。

正确的PATCH请求体只需保留必要的字段:

{
  "@odata.type": "#microsoft.graph.bookingAppointment",
  "customers": [
    {
      "@odata.type": "#microsoft.graph.bookingCustomerInformation",
      "customerId": "<my-customer-id>",
      "emailAddress": "test@example.com",
      "name": "Test Testson",
      "customQuestionAnswers": [
        {
          "@odata.type": "#microsoft.graph.bookingQuestionAnswer",
          "questionId": "9f66cb07-abbc-4427-b3ea-b6a4da80d10d",
          "selectedOptions": [
            "Video"
          ]
        }
      ]
    }
  ]
}

额外说明:

  • 如果是文本输入类型的自定义问题,将selectedOptions替换为answerValue字段即可,比如:"answerValue": "用户输入的文本内容"
  • 无需提交customers对象中未变更的字段(如location、phone、notes等),仅保留需要更新的字段,能减少请求出错的概率。

内容的提问来源于stack exchange,提问作者Oskar Persson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 11:20:54