Site Pages API endpoint: Error when expanding webParts or canvasLayout properties on sitePage resource type
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
- [ ] 💥 Internet Explorer
- [X] 💥 Microsoft Edge
- [ ] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [ ] other (enter in the "Additional environment details" area below)
Additional environment details
using Graph API for SharePoint Site Pages
Describe the bug / error
When expanding webParts or canvasLayout properties on sitePage resource type (using Graph API), the "pages" endpoint returns HTTP 500 Status with "code": "generalException", "message": "General exception while processing" for some of our "modern" Site Pages:
-
Sample URL:
https://graph.microsoft.com/v1.0/sites/{site-id}/pages/{page-id}/microsoft.graph.sitePage?$expand=webParts -
It fails the same while not using $expand approach, like this:
https://graph.microsoft.com/v1.0/sites/{site-id}/pages/{page-id}/microsoft.graph.sitePage/webParts. -
The error is the same for
betaas well as forv1.0graph api versions. -
When not expanding
webPartsorcanvasLayoutproperties, pages endpoint works fine, we have 800 Site Pages in total returned in response. -
For some of our pages, the
webPartsandcanvasLayoutproperties are expanded correctly and api returns expected response (roughly half of our pages are failing). We did not find out what make the difference, failing pages look just normal while opening them in our SharePoint Online tenant.
Steps to reproduce
- Use Graph Explorer (at https://developer.microsoft.com/en-us/graph/graph-explorer), so using Delegated api permissions type)
- We also tried via Graph API SDK with
Sites.SelectedApplicatin api permission, it behaves the same, some pages working, some not working.
Expected behavior
API returns Site Page with expanded webParts or canvasLayout properties.