sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Site Pages API endpoint: Error when expanding webParts or canvasLayout properties on sitePage resource type

Open vstribrny opened this issue 1 year ago • 0 comments

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 beta as well as for v1.0 graph api versions.

  • When not expanding webParts or canvasLayout properties, pages endpoint works fine, we have 800 Site Pages in total returned in response.

  • For some of our pages, the webParts and canvasLayout properties 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

  1. Use Graph Explorer (at https://developer.microsoft.com/en-us/graph/graph-explorer), so using Delegated api permissions type)
  2. We also tried via Graph API SDK with Sites.Selected Applicatin api permission, it behaves the same, some pages working, some not working.

Expected behavior

API returns Site Page with expanded webParts or canvasLayout properties.

vstribrny avatar Apr 12 '24 09:04 vstribrny