Get the ID used in a link for accessing a Booking appointment

Steel Contributor

Is there a way to get the ID used in a link to the booking appointment with Graph API?

 

https://outlook.office365.com/owa/calendar/[BookingCalendarAddress]/bookings/xxxxxxxxxxxxxxxxxxxxx

 

This ID is not the Appointment ID returned by graph API...

 

BookingLink.png

18 Replies

@Martin Coupal , did you ever found an answer to this question? I ran into the same issue where I need this booking id so that I can get back to an existing booking on the bookings page using this id. The appointment id stored in bookings is a different one that's returned by the graph API.

@Sukumar2021, no I did not find this information. I guess it should be returned by the graph.microsoft.com/beta/bookingBusinesses/ api but it is not for now....

@Martin Coupal  is there any solution available?

 

I also need this Id.

 

Regards

Found the solution. Subscriptionid field is rather converted to short id used in the link. Subscriptionid is converted to 22 char shortid using convert.tobase64string method.

@Sukumar2021 Thank you. By Subscription Id, do you mean appointment Id?

 

Graph Query:

 

https://graph.microsoft.com/beta/bookingBusinesses/Development@123.onmicrosoft.com/appointments

 

Results: 

umer_j_0-1614675289451.png

Regards Umer

Sorry. I meant selfserviceappointmentid which’s a guid and one of the booking fields.
Hi. Thank you very much for your reply. I am clear about selfserviceappointmentId but what do u mean by one of the booking fields. ? As I understood, I have to convert selfserviceappointmentId to 22 char shortid using convert.tobase64string to get last part of Url?

Regards Umer

Best Regards

Umer Javaid
Hi Umer, that’s correct. You need to convert selfserviceappointmentid to 22 char short id.
Hi @Sukumar2021 , can you pleaes elloborate what do you mean by 22 char short id. If I encode selfserviceappointmentid as base64 using online converter, I get competely different encoded string. Can you please help me to point to right resource. I have selfserviceappointmentid " cb34c6ef-b947-412a-96a1-03fb553774c5". what will be the encrypted value ?
You need to first convert the guid value to tobytearray() and pass that value as a parameter to tobase64string method to get the short id.
Hi @Sukumar2021,

I just want to know if this is possible inside the Power Automate? Checking the conversions it seems there is not tobytearray() available.
Unfortunately, this functionality is not available in power automate. You have to use azure functions and call this function from power automate.

@Sukumar2021 One more thing to be noticed. It is not possible to get meeting Id in case of group meeting. If your resource has capicity more then one, then above mentioned method will not work

 

Regards

 

Thank you very much for the quick response @Sukumar2021! Yeah I guess Azure Functions is the only way to do it in Power Automate.
Is this still the case?

Anyone have tips on getting appointment details by power automate or some other method? Looking for details on all appointment details

@developert2lpr use GraphApi to get the details of the service, including "webUrl", which has the direct link to the service in it: Get bookingService - Microsoft Graph v1.0 | Microsoft Learn

@tpoltorak 

I tried this in PHP as follows but the resulting URL was invalid.

 

The Self Service Appointment Id guid looks like this: "bd01de34-acd7-44c1-9dbe-d4d2b4cedfb7"

 

$bytes = unpack("C*", hex2bin(str_replace('-', '', $guid)));
$base64 = base64_encode(call_user_func_array("pack", array_merge(array("C*"), $bytes)));

 

This was the output for $base64: +zBNbEGoS7iXtg41xnewEg==

 

The doesn't look like the URL from MS Bookings as it only has alphnumerics. What have I missed?

 

Thanks, Nick

 

 

@Sukumar2021 

Hi, I have the same problem with the link.

I follow your instructions using C#, and ended up like this:

byte[] bytes = Guid.Parse(SomeString).ToByteArray(); // Convert the SubscriptionId to bytes

                // Convert the trimmed bytes to Base64
                string shortId = Convert.ToBase64String(trimmedBytes).Substring(0, 22); // Get the first 22 characters

 

And it still doesn't work. I tried not trimming the result, and I got a string with 24 characters (which also didn't work). Do you know if I made a mistake?