Graph API error when querying BookingBusinesses - ErrorExceededFindCountLimit, The GetBookingMailboxes request returned too many results


⛔️ PROBLEM

You are trying to get booking businesses using GET request using Graph API but receive ErrorExceededFindCountLimit error.
|Request --> GET https://graph.microsoft.com/beta/bookingBusinesses
Microsoft Graph API error ErrorExceededFindCountLimit
Microsoft Graph API error ErrorExceededFindCountLimit
Error:
{
  "error": {
    "code": "ErrorExceededFindCountLimit",
    "message":
      "The GetBookingMailboxes request returned too many results. Please specify a query to limit the results.",
  }
}

⚑️ ANALYSIS

Service account is setup in Azure AD with App Registration with necessary permissions - Bookings.Read.All, BookingsAppointment.ReadWrite.All, Bookings.ReadWrite.All, Bookings.Manage.All. But you receive error when executing the code.

As the error states "returned too many results", the return values look to be beyond the set threshold. Getting the list of bookingBusinesses may also fail when an organization has several Bookings businesses and the account making the request is not an administrator.

⛏️ Fix ErrorExceededFindCountLimit error when querying bookingBusinesses using Microsoft Graph ?

Limit the request to return the set of businesses by including a query parameter. This will limit the result set and return the businesses that have given search text in their name or e-mail address.
GET https://graph.microsoft.com/beta/bookingBusinesses?query=Code2Care

Using this approach, you can now pass the name or email id of the business that you want to query and fetch limited results.
Advertisements
Try Out Code2care Dev Tools:

Advertisements



#Android #Java #Linux #Microsoft #Google #Python #MacOS #Notepad++ #Microsoft Teams #CSS #PHP #SharePoint #Html #Linux #C-Program #Bootstrap #jQuery #Sublime #Android-Studio #Facebook #Eclipse #WhatsApp #News #MySQL #Json #HowTos #JavaScript #FTP #S3


Advertisements


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
πŸŽ‰ We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR - https://donate.unhcr.org/in/en-in/ukraine-emergency