Forum Discussion
The endpoint getStaffAvailability returning Unknown Error
I know that Graph Explorer can't be used as it only support Delegate Permissions, so I've been using Postman instead and testing in PHP from my local development environment. Nothing works.
I just get 'Unknown Error'. This is my request (with Auth token truncated by me).
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/email address removed for privacy reasons/microsoft.graph.getStaffAvailability',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"staffIds": [
"79d094f1-8a95-45f7-96ed-ec8fa98e76a3"
],
"startDateTime": {
"dateTime": "2022-01-25T00:00:00",
"timeZone": "Pacific Standard Time"
},
"endDateTime": {
"dateTime": "2022-01-26T17:00:00",
"timeZone": "Pacific Standard Time"
}
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJ0eXAiOiJKV1...',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
I have the exact same issue. My application has bookings.Manage.All Application but I get unknownError , Cant get it to work.
To get the application I use the following is that correct ?
curl --location 'https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id={client_id}' \
--data-urlencode 'scope=https://graph.microsoft.com/.default' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_secret={client_secret}'
- IOOFGeoffreyThomazeauJul 01, 2025Copper Contributor
After a lot of try and error. I finally got it working.
Application permission need to have Bookings.Read.All. If you have only Bookings.manage.All the endpoint won't work which doesn't make sense according the documentation mentioning higher permission : Booking.Manage.All