Is there an API that returns the property values for webparts in a page (for classic sites as well as modern sites)? We would like to index the static text properties associated with the web part (for example the text associated with a link web part).
Asked
Active
Viewed 661 times
1 Answers
0
You could only use rest api to get web part properties in classic page like the following:
/_api/Web/GetFileByServerRelativeUrl('/sites/michael/SitePages/yourpage.aspx')/GetLimitedWebPartManager(scope=1)/WebParts?$expand=WebPart

Michael Han
- 3,475
- 1
- 6
- 8
-
Thanks for the pointer. The response does not give the text/other config for the webpart. Do you know how I could get that? I am looking for something similar to the CanvasContent1 property of modern site pages that has the text, links etc entered for the web part. – Vishwanath T R Jan 21 '21 at 16:48
-
No, we can not get wepparts of modern pages with rest api. Web Parts in modern pages are client side which can not be returned through rest api. You could use pnp powershell to get webparts in modern pages. – Michael Han Jan 22 '21 at 02:39
-
Thanks. For classic pages is there a way to get the webparts configuration? Alternatively is there an analog of the CanvasContent1 page property for classic pages? – Vishwanath T R Jan 22 '21 at 04:05