最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Cannot update customQuestionAnswers in Microsoft Booking with Graph API - Stack Overflow

programmeradmin1浏览0评论

How am I supposed to update customQuestionAnswers on a Booking Appointment in the Microsoft Graph API? This is what I've tried:

PATCH .0/solutions/bookingBusinesses/<businessId>/appointments/<appointmentId>

{
  "@odata.type": "#microsoft.graph.bookingAppointment",
  "customers": [
    {
      "@odata.type": "#microsoft.graph.bookingCustomerInformation",
      "customerId": "<my-customer-id>",
      "emailAddress": "[email protected]",
      "location": null,
      "name": "Test Testson",
      "notes": "",
      "phone": null,
      "timeZone": null,
      "customQuestionAnswers": [
        {
          "@odata.type": "microsoft.graph.bookingQuestionAnswer",
          "questionId": "9f66cb07-abbc-4427-b3ea-b6a4da80d10d",
          "isRequired": true,
          "selectedOptions": [
            "Video"
          ],
          "question": "Mötestyp",
          "answerOptions": [
            "Video",
            "Telefon"
          ],
          "answerInputType": "radioButton"
        }
      ]
    }
  ]
}

This results in the following error:

{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "date": "2025-02-11T12:40:27",
            "request-id": "f10492fe-93f6-42b7-8cc4-f675fa705e47",
            "client-request-id": "f713f76d-c962-a2e9-8694-7fafa2f83eb1"
        }
    }
}

Removing the customQuestionAnswers block "solves" the issue.

How am I supposed to update customQuestionAnswers on a Booking Appointment in the Microsoft Graph API? This is what I've tried:

PATCH https://graph.microsoft/v1.0/solutions/bookingBusinesses/<businessId>/appointments/<appointmentId>

{
  "@odata.type": "#microsoft.graph.bookingAppointment",
  "customers": [
    {
      "@odata.type": "#microsoft.graph.bookingCustomerInformation",
      "customerId": "<my-customer-id>",
      "emailAddress": "[email protected]",
      "location": null,
      "name": "Test Testson",
      "notes": "",
      "phone": null,
      "timeZone": null,
      "customQuestionAnswers": [
        {
          "@odata.type": "microsoft.graph.bookingQuestionAnswer",
          "questionId": "9f66cb07-abbc-4427-b3ea-b6a4da80d10d",
          "isRequired": true,
          "selectedOptions": [
            "Video"
          ],
          "question": "Mötestyp",
          "answerOptions": [
            "Video",
            "Telefon"
          ],
          "answerInputType": "radioButton"
        }
      ]
    }
  ]
}

This results in the following error:

{
    "error": {
        "code": "UnknownError",
        "message": "",
        "innerError": {
            "date": "2025-02-11T12:40:27",
            "request-id": "f10492fe-93f6-42b7-8cc4-f675fa705e47",
            "client-request-id": "f713f76d-c962-a2e9-8694-7fafa2f83eb1"
        }
    }
}

Removing the customQuestionAnswers block "solves" the issue.

Share Improve this question asked Feb 11 at 12:50 Oskar PerssonOskar Persson 6,76517 gold badges70 silver badges133 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I think you are missing the answer property for the bookingQuestionAnswer. The value of the answer property cannot be null. It must be at least empty string.

{
  "@odata.type": "#microsoft.graph.bookingAppointment",
  "customers": [
    {
      "@odata.type": "#microsoft.graph.bookingCustomerInformation",
      "customerId": "<my-customer-id>",
      "emailAddress": "[email protected]",
      "location": null,
      "name": "Test Testson",
      "notes": "",
      "phone": null,
      "timeZone": null,
      "customQuestionAnswers": [
        {
          "@odata.type": "microsoft.graph.bookingQuestionAnswer",
          "questionId": "9f66cb07-abbc-4427-b3ea-b6a4da80d10d",
          "isRequired": true,
          "selectedOptions": [
            "Video"
          ],
          "question": "Mötestyp",
          "answerOptions": [
            "Video",
            "Telefon"
          ],
          "answerInputType": "radioButton",
          "answer": ""
        }
      ]
    }
  ]
}
发布评论

评论列表(0)

  1. 暂无评论