We are trying to get booking businesses using the following GET request:
https://graph.microsoft.com/beta/bookingBusinesses
We've set up a service account in our Azure AD together with App Registration with following permissions:
Bookings.Read.All,
BookingsAppointment.ReadWrite.All,
Bookings.ReadWrite.All,
Bookings.Manage.All
However, when we run our code we get the following error message:
{
"error": {
"code": "ErrorExceededFindCountLimit",
"message":
"The GetBookingMailboxes request returned too many results. Please specify a query to limit the results.",
"innerError": {
"request-id": "915fef1e-8f29-43d8-97c1-091bcf2f406e",
"date": "2018-06-06T10:03:21"
}
}
}
Can you please give us the information on how to overcome that Exceeded Find Count Limit Error? We've tried standard OData query options like $top and we are still getting the same error. Or maybe we have set up something in our Azure AD in a wrong way?
Here is a snippet of our code:
``` C#
static void Main(string[] args) {
try {
// Get an access token and configure the HttpClient
var accessToken = GetAccessToken();
var httpClient = GetHttpClient(accessToken);
var url = GraphResource + GraphVersion + "/bookingBusinesses";
var result = GetResult(httpClient, url).Result;
Console.WriteLine(result);
} catch (Exception e) {
Console.WriteLine(e);
}
Console.WriteLine("Done. Press any key to exit.");
Console.ReadKey();
}
public class AzureAuthenticationProvider : IAuthenticationProvider {
public async Task AuthenticateRequestAsync(HttpRequestMessage request) {
var context = new AuthenticationContext("https://login.windows.net/" + AzureTenantId);
var userCred = new UserCredential(svcAccountUPN, svcAccountPW);
var result = await context.AcquireTokenAsync(GraphResource, ClientId, userCred);
request.Headers.Add("Authorization", "Bearer " + result.AccessToken);
}
}
//gets the result of the query
static async Task
using(var r = await client.GetAsync(new Uri(url))) {
var result = await r.Content.ReadAsStringAsync();
return result;
}
}
// Get an access token for the Microsoft Graph using ADAL
public static string GetAccessToken() {
var context = new AuthenticationContext("https://login.windows.net/" + AzureTenantId);
var userCred = new UserCredential(svcAccountUPN, svcAccountPW);
var result = context.AcquireTokenAsync(GraphResource, ClientId, userCred);
if (result == null) {
throw new InvalidOperationException("Failed to obtain the JWT token");
}
return result.Result.AccessToken;
}
// Prepare an HttpClient with the an authorization header (access token)
public static HttpClient GetHttpClient(string accessToken) {
// Create the HTTP client with the access token
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer",
accessToken);
return httpClient;
}
```
Please can we get some help!

We created a new account, added 150 businesses. And got the error. Here you can see $top not working and the error exceeding issue.
$skip does not work either :(
weird, we have graph api working with our global admin account. However the service account we made in AD doesnt work. So we made that global admin. We matched the permissions in "modify permissions" in graph explorer, but still it doesnt work. Really weird!!
Hi @MichalWierzbinskiEnvokeit, the error you are seeing is due to an unfortunate limitation on how the Bookings API gets its data out of the underlying system. $skip and $top indeed do not help in that case.
Right now we have two mitigations in place:
For example, calling https://graph.microsoft.com/beta/bookingBusinesses?query=foo will return the businesses that have "foo" in their name or e-mail address. But keep in mind that the result with this query parameter is also limited by the underlying system.
@fpintos is it possible to add this to the documentation page here https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/bookingbusiness_get so that it is clear query is possible. And also to document this known limitation?
Is this broader than just bookingbusiness?
@jthake I've created a PR to update the documentation: #2794
The issue is specific to GET bookingBusinesses
Thanks!!! We can work with the query string to make it work!! Awesome! Big relief here! :)
What do you mean with tenant admin?
is it Azure AD admin, or Exchange, or Global admin?
Thanks
@kolomolo An Office 365 Global admin or an Exchange admin will have permission to enumerate other businesses, past the limit that is imposed to non-admins.
@kolomolo I'm going to close this unless you have any further questions regarding this particular issue?
How is it a feature request and not a bug? Surely it should be kept open so it can be tracked and fixed? Many Thanks for all the support so far, it defintely helped, but instead of using the API i've had to use an admin account to see all the sites and store in a DB. It's a work around to a bug.
Feature requests are actually tracked on our UserVoice site. https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/category/101632-microsoft-graph-o365-rest-apis
If you want to create the feature request there. THat's where progress will be tracked on improving this scenario.
How is listing your businesses a feature? The API is broken, and I would think that seeing as every business registered is actually a license purchased from Microsoft, my customer has 150 businesses, I would have thought this would be something to actually fix than sweep under the carpet as a feature request. pah.. Disappointed with your approach @jthake-msft This just makes me want to code the front end part now, it wouldn't take much more effort and we wouldn't need all those lics...
I was talking to the feature team and the understanding is that the limit was put in place there for user interface reasons; it came up when the target was small tenants, which would have only a few of these, so it wasn't an issue.
Now that we're exposing the API in Graph and allowing a lot more of these to be created that limit is not really applicable, so we're investigating what it takes to remove it.
OK thanks! :)
Most helpful comment
I was talking to the feature team and the understanding is that the limit was put in place there for user interface reasons; it came up when the target was small tenants, which would have only a few of these, so it wasn't an issue.
Now that we're exposing the API in Graph and allowing a lot more of these to be created that limit is not really applicable, so we're investigating what it takes to remove it.