API to read text content of SharePoint site page

Microsoft

Hi,

 

Is there any API available to read text content of SharePoint site page?

 

Thanks.

2 Replies

@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.