Modern SharePoint Sites - News Page API

%3CLINGO-SUB%20id%3D%22lingo-sub-68191%22%20slang%3D%22en-US%22%3EModern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-68191%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20folks%20-%20So%20I'm%20looking%20to%20see%20if%20there's%20a%20way%20to%20programatically%20(API)%20get%20the%20news%20page%20(%26amp%3B%20its%20content)%20from%20the%20modern%20team%20sites%3F%20I%20want%20to%20use%20the%20news%20pages%20and%20its%20content%20but%20display%20it%20on%20a%20custom%20UI%20page.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20guide%20me%20in%20the%20right%20direction%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-68191%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-82128%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-82128%22%20slang%3D%22en-US%22%3E%3CP%3EI%20found%20this%26nbsp%3Bquestion%20because%20I%20was%20trying%20to%20get%20CSWP%20to%20work%20with%20news%20pages%20in%20the%20modern%20team%20site.%20I%20have%20been%20unsuccessful.%20I'm%20not%20trying%20to%20display%20on%20a%20custom%20UI%20page%20like%20you%2C%20I'm%20curious%20if%20my%20inability%20to%20get%20CSWP%20to%20work%20with%20these%20sites%20is%20user%20error%20or%20a%20known%2Fplanned%20issue%3F%20I%20haven't%20found%20much%20online%20help%20either%20way.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-80338%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-80338%22%20slang%3D%22en-US%22%3EWe%20have%20used%20the%20API%20as%20is%20to%20show%20SharePoint%20News%20alongside%20corporate%20News%20on%20an%20Intranet%20home%20page%20so%20the%20summary%20was%20sufficient.%3CBR%20%2F%3EYou%20can%20also%20get%20the%20data%20through%20search%20that%20may%20contain%20more%20of%20the%20content%20but%20generally%20the%20index%20only%20has%20a%20summary.%3CBR%20%2F%3EI%20think%20i%20saw%20an%20article%20by%20Elio%20Struyf%20on%20how%20this%20search%20query%20works.%20You%20can%20also%20just%20use%20the%20network%20trace%20on%20a%20SharePoint%20site%20to%20find%20this.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-79482%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-79482%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F180%22%20target%3D%22_blank%22%3E%40Alan%20Marshall%3C%2FA%3E%26nbsp%3Bfor%20the%20link%20too.%20Were%20you%20able%20to%20get%20the%20news%20page%20description%20too%3F%20We%20noticed%20that%20these%20API%20calls%20only%20get%20a%20very%20limited%20characters%20as%20a%20response.%20Can%20we%20get%20the%20entire%20news%20page%20content%20through%20the%20API%3F%20Is%20there%20something%20you%20know%20we%20can%20do%20to%20get%20that%20too%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-79049%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-79049%22%20slang%3D%22en-US%22%3E%3CP%3EThanks!%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20of%20developers%20in%20the%20team%20found%20that%20out%20too!%20Will%20need%20to%20try%20this%20out%20and%20see%20what%20all%20we%20are%20able%20to%20get%20with%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-78971%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78971%22%20slang%3D%22en-US%22%3EDOH!%20We%20should%20have%20known%20that....%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-78959%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78959%22%20slang%3D%22en-US%22%3EIt's%20actually%20just%20a%20query%20of%20pages%20where%20a%20column%20says%20it%20should%20be%20promoted.%20If%20you%20use%20the%20network%20view%20on%20the%20SharePoint%20page%2C%20you%20can%20find%20the%20call%20to%20the%20API.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fspe248239.sharepoint.com%2F_vti_bin%2Fhomeapi.ashx%2Fnews%3Fstart%3D0%26amp%3Bcount%3D200%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fspe248239.sharepoint.com%2F_vti_bin%2Fhomeapi.ashx%2Fnews%3Fstart%3D0%26amp%3Bcount%3D200%3C%2FA%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-78786%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-78786%22%20slang%3D%22en-US%22%3E%3CP%3ENope.%20Still%20waiting.%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-76902%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20SharePoint%20Sites%20-%20News%20Page%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-76902%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F6699%22%20target%3D%22_blank%22%3E%40Nikhil%20Nulkar%3C%2FA%3E%26nbsp%3B--%20ever%20get%20an%20answer%20to%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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
Highlighted

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

Highlighted

Nope. Still waiting. :(

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

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.

Highlighted

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?

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

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.