Modern SharePoint Sites - News Page API

Brass Contributor

Hey folks - So I'm looking to see if there's a way to programatically (API) get the news page (& its content) from the modern team sites? I want to use the news pages and its content but display it on a custom UI page.

 

Can anyone guide me in the right direction?

8 Replies

@Nikhil Nulkar -- ever get an answer to this?

Nope. Still waiting. :(

It's actually just a query of pages where a column says it should be promoted. If you use the network view on the SharePoint page, you can find the call to the API.
https://spe248239.sharepoint.com/_vti_bin/homeapi.ashx/news?start=0&count=200
DOH! We should have known that....

Thanks! :)

 

One of developers in the team found that out too! Will need to try this out and see what all we are able to get with it.

Thanks @Alan Marshall for the link too. Were you able to get the news page description too? We noticed that these API calls only get a very limited characters as a response. Can we get the entire news page content through the API? Is there something you know we can do to get that too?

We have used the API as is to show SharePoint News alongside corporate News on an Intranet home page so the summary was sufficient.
You can also get the data through search that may contain more of the content but generally the index only has a summary.
I think i saw an article by Elio Struyf on how this search query works. You can also just use the network trace on a SharePoint site to find this.

I found this question because I was trying to get CSWP to work with news pages in the modern team site. I have been unsuccessful. I'm not trying to display on a custom UI page like you, I'm curious if my inability to get CSWP to work with these sites is user error or a known/planned issue? I haven't found much online help either way.