Microsoft have updated the documentation for this endpoint - the URL has changed from:
https://graph.microsoft.com/beta/sites/{{siteId}}/pages?$expand=webParts&$top=10
To:
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When trying to call the Beta Graph API, I can no longer expand the related webparts because of the below error in the response:
{
"error": {
"code": "invalidRequest",
"message": "Could not find a property named 'webParts' on type 'oneDrive.baseSitePage'.",
"innerError": {
"date": "2023-07-13T15:33:27",
"request-id": "433ca266-ebce-4270-bac7-9db72f86f384",
"client-request-id": "433ca266-ebce-4270-bac7-9db72f86f384"
}
}
}
My request looks as below:
https://graph.microsoft.com/beta/sites/{{siteId}}/pages?$expand=webParts&$top=10
Where {{siteId}} is the ID of the site I'm retrieving pages for, which previously worked. If I remove the $expand the request works but doesn't include the webParts data that I need.
Has anyone else seen this error or know how to resolve it?
Microsoft have updated the documentation for this endpoint - the URL has changed from:
https://graph.microsoft.com/beta/sites/{{siteId}}/pages?$expand=webParts&$top=10
To:
The error message you received indicates that the property 'webParts' is not found on the 'oneDrive.baseSitePage' type in the Microsoft Graph API response. This could mean that the 'webParts' property is not available or accessible for the specified API endpoint.
The behavior you're experiencing might be due to changes or updates in the Graph API since my knowledge cutoff in September 2021. The Microsoft Graph API is regularly updated, and some features may change or be deprecated over time.
To address this issue, I recommend the following steps:
Check Microsoft Graph API documentation: Review the Microsoft Graph API documentation for the specific endpoint you are using to retrieve site pages. Make sure that the 'webParts' property is still supported and can be expanded for the 'oneDrive.baseSitePage' type. The documentation may provide information on any recent changes or alternative methods to retrieve web parts data.
Check API version: Verify that you are using the correct API version. In your example, you are using the 'beta' version. Try using a different version, such as 'v1.0', to see if the issue persists. Microsoft may introduce changes in beta versions that are not fully supported or might have different behavior.
Contact Microsoft support: If the issue persists or you require further assistance, it is recommended to contact Microsoft support. They can provide specific guidance and help troubleshoot the issue with the Graph API, including any recent changes or known issues.
By referring to the documentation and reaching out to Microsoft support, you should be able to get the most up-to-date information and guidance to resolve the error and retrieve the required 'webParts' data from the Microsoft Graph API.