使用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
相关产品推荐
相关产品推荐

