Jul 19 2022 08:40 AM - edited Jul 19 2022 08:42 AM
Hi,
Is there any API available to read text content of SharePoint site page?
Thanks.
Aug 04 2022 01:53 AM
Hello @VikasNeelam
do you looking for that? https://sharepointcass.com/2020/07/16/extracting-sharepoint-online-page-content-and-embedding-the-ht...
Regards, Dave
Aug 04 2022 02:15 AM
@VikasNeelam You can read the text content of site page using SharePoint REST API like:
https://contoso.sharepoint.com/sites/work/_api/web/lists/getbytitle('Site Pages')/items(1)/FieldValuesAsText?$select=CanvasContent1
Where 1 in items(1) is the item ID of site page. CanvasContent1 property returns the content on site page.
You can also get the site page content as HTML using API:
https://contoso.sharepoint.com/sites/work/_api/web/lists/getbytitle('Site Pages')/items(1)/FieldValuesAsHtml?$select=CanvasContent1
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.