Forum Discussion
HopkinsRaz
Oct 07, 2022Copper Contributor
Pulling URLs from infinite scroll SharePoint page
I'm trying to put together a list of articles and their URL from a corporate intranet that is built on SharePoint. These articles are displayed on pages titled with the name of each department follow...
SvenSieverding
Oct 13, 2022Bronze Contributor
The "pageslistid" is the internal id of your sitepages library.
The "news.aspx" page aggregates all news articles from the given sources and each news article is a single file in the sitepages library with the property promotedState set to 2.
I understand that you want to fetch the list of the articles... You could try to use SharePoint Search for that
/_api/search/query?querytext='IsDocument:True AND FileExtension:aspx AND PromotedState:2 Path:<Sitecollections you want the news from>'&selectproperties='Description,PictureThumbnailURL,CanvasContent1OWSHTML'
You will get the properties "Description" and "PictureThumbnailURL" containing the teaser text and the teaser image for each news article from the search results.
The Property "CanvasContent1OWSHTML" will contain the entire single news artigle encoded as an html file
The "news.aspx" page aggregates all news articles from the given sources and each news article is a single file in the sitepages library with the property promotedState set to 2.
I understand that you want to fetch the list of the articles... You could try to use SharePoint Search for that
/_api/search/query?querytext='IsDocument:True AND FileExtension:aspx AND PromotedState:2 Path:<Sitecollections you want the news from>'&selectproperties='Description,PictureThumbnailURL,CanvasContent1OWSHTML'
You will get the properties "Description" and "PictureThumbnailURL" containing the teaser text and the teaser image for each news article from the search results.
The Property "CanvasContent1OWSHTML" will contain the entire single news artigle encoded as an html file