Open heinrich-ulbricht opened 1 year ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Are you only attempting to get the count? The pagination makes sense by default, as getting 130,000+ pages returned in a single API call is probably unnecessarily taxing to both the client and the server.
If you are trying to get only the count, could you try using $count
as a URL segment instead of a query parameter (i.e. as a /
instead of a ?
, e.g.:
https://graph.microsoft.com/beta/sites/<siteid>/pages/microsoft.graph.sitePage/$count=true
Yes I'm only interested in the count. I'm not expecting 130000 pages to be returned. I just mentioned the number since it might make a difference in the backend when getting the count.
Interesting approach using it as URL segment, didn't notice this option. But it does not want it:
https://graph.microsoft.com/beta/sites/<siteid>/pages/microsoft.graph.sitePage/$count=true
returns:
{
"error": {
"code": "BadRequest",
"message": "The request URI is not valid. Since the segment 'microsoft.graph.sitePage' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource.",
"innerError": {
"date": "2023-08-22T19:38:05",
"request-id": "0bf73008-6f71-4fec-b24e-cc17736f795d",
"client-request-id": "5a8b5de1-ed7c-a9cc-00f2-f460f45a8c8b"
}
}
}
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
other (enter in the "Additional environment details" area below)
Developer environment
Windows
What browser(s) / client(s) have you tested
Additional environment details
Describe the bug / error
My goal is to get the count of pages in the Site Pages library of a site.
According to the beta endpoint documentation the
$count
parameter is supported.I add the
$count
parameter, the result contains a count, but the count only reflects the number of returned pages - which makes no sense. I expect the overall count of pages.Steps to reproduce
Call
https://graph.microsoft.com/beta/sites/<siteid>/pages/microsoft.graph.sitePage?$count=true
on a site with more than 200 pages (200 pages seems to be the default response-page size, so make the number of pages in the site larger).Expected behavior
I expect the overall number of pages to be returned. I have a test site with 130000 pages, so I'd expect a count of 130000 to be returned. Not 200.
The response for above call for me yields (in Graph Explorer):
By the way when restricting the call with the $top=1 parameter to return only one item, the count is .... 1. This count is useless XD
How is the $count param intended to work for sitePages?