Forum Discussion
The endpoint getStaffAvailability returning Unknown Error
We are trying to access the endpoint https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/{bookingBusiness-id}/microsoft.graph.getStaffAvailability but it returns Unknown Error as described here: microsoft.graph.getStaffAvailability returns UnknownError and has a N/A Permission · Issue #2043 · microsoftgraph/microsoft-graph-explorer-v4 (github.com)
The endpoint only supports application permissions, and we are sending the correct scopes (https://graph.microsoft.com/.default). We are still however getting Unknown Error
5 Replies
- nick_amisCopper ContributorI'm having the same problem and I'm using Application Permissions. Calls to other endpoints work find but the getStaffAvailability just won't play ball!
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;- IOOFGeoffreyThomazeauCopper Contributor
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}'
- IOOFGeoffreyThomazeauCopper 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
- EvansAboge
Microsoft
nick_amis Apologies for this experience. Let me escalate this
- nick_amisCopper ContributorThank you. Much appreciated.