0

when I trying to create Microsoft Booking Appointment through Graph API Only Post Request Not working . GET , PATCH , DELETE Reuqest are working fine through postman

same post request is working find on graph explorer platform . but not on posmant with my auth token

my post API

https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/XXXXXXXXXXXXXXX.com/appointments

and body (took example from here) excluded optional properties like servicename and customers

     {
    "@odata.type": "#microsoft.graph.bookingAppointment",
    "customerTimeZone": "America/Chicago",
    "smsNotificationsEnabled": false,
    "endDateTime": {
        "@odata.type": "#microsoft.graph.dateTimeTimeZone",
        "dateTime": "2023-01-02T14:30:00.0000000",
        "timeZone": "UTC"
    },
    "isLocationOnline": true,
    "optOutOfCustomerEmail": false,
    "anonymousJoinWebUrl": null,
    "postBuffer": "PT10M",
    "preBuffer": "PT5M",
    "price": 10,
    "priceType@odata.type": "#microsoft.graph.bookingPriceType",
    "priceType": "fixedPrice",
    "reminders@odata.type": "#Collection(microsoft.graph.bookingReminder)",
    "reminders": [
        {
            "@odata.type": "#microsoft.graph.bookingReminder",
            "message": "This service is tomorrow",
            "offset": "P1D",
            "recipients@odata.type": "#microsoft.graph.bookingReminderRecipients",
            "recipients": "allAttendees"
        },
        {
            "@odata.type": "#microsoft.graph.bookingReminder",
            "message": "Please be available to enjoy your lunch service.",
            "offset": "PT1H",
            "recipients@odata.type": "#microsoft.graph.bookingReminderRecipients",
            "recipients": "customer"
        },
        {
            "@odata.type": "#microsoft.graph.bookingReminder",
            "message": "Please check traffic for next cater.",
            "offset": "PT2H",
            "recipients@odata.type": "#microsoft.graph.bookingReminderRecipients",
            "recipients": "staff"
        }
    ],
    "serviceId": "XXXXXXXXXXXXXXXXXXXXX",
    "serviceLocation": {
        "@odata.type": "#microsoft.graph.location",
        "address": {
            "@odata.type": "#microsoft.graph.physicalAddress",
            "city": "Buffalo",
            "countryOrRegion": "USA",
            "postalCode": "98052",
            "postOfficeBox": null,
            "state": "NY",
            "street": "123 First Avenue",
            "type@odata.type": "#microsoft.graph.physicalAddressType",
            "type": null
        },
        "coordinates": null,
        "displayName": "Customer location",
        "locationEmailAddress": null,
        "locationType@odata.type": "#microsoft.graph.locationType",
        "locationType": null,
        "locationUri": null,
        "uniqueId": null,
        "uniqueIdType@odata.type": "#microsoft.graph.locationUniqueIdType",
        "uniqueIdType": null
    },
    "serviceNotes": "Customer requires punctual service.",
    "startDateTime": {
        "@odata.type": "#microsoft.graph.dateTimeTimeZone",
        "dateTime": "2023-01-02T14:00:00.0000000",
        "timeZone": "UTC"
    },
    "maximumAttendeesCount": 1,
    "filledAttendeesCount": 1
}
neeraj
  • 345
  • 2
  • 6
  • 19
  • Since I can't test in my side, it's only an assumption. I checked [the example](https://learn.microsoft.com/en-us/graph/api/bookingbusiness-post-appointments?view=graph-rest-1.0#example) for the post request, it contained a lot of properties in the request body, but yours not. Then I checked the [properties](https://learn.microsoft.com/en-us/graph/api/resources/bookingappointment?view=graph-rest-1.0#properties), I found only 2 of them mentioned it's `optional`. So could you pls follow the example and test again? – Tiny Wang Jan 13 '23 at 06:01
  • added all properties except optional properties , still unknown error from postman , but created successfully from Graph explorer – neeraj Jan 13 '23 at 07:36
  • hmmm, we can't explain what is unknow error.... – Tiny Wang Jan 13 '23 at 07:42
  • any microsoft community where we can send this error – neeraj Jan 13 '23 at 07:51
  • not sure, maybe this one: https://github.com/microsoftgraph/microsoft-graph-docs/issues – Tiny Wang Jan 13 '23 at 07:57

0 Answers0