Get content of news posts using REST api
-
08-02-2021 - |
Вопрос
The goal is to use REST to pull content into a homegrown mobile app. I'm able to run simple API calls like this and get results:
https://xxx.sharepoint.com/sites/xxx/_api/web/lists/getbytitle('Site Pages')/items?$select=Title
But I can't figure out how to get the full content of news posts, which I believe is in a container named "CanvasContent" i.e title, author byline, first published date, body content, banner image thumbnail, etc.
Решение 2
I had already tried @ganesh sanap's suggestion but it doesn't get the body content. Figured it out though - needed to add CanvasContent1 in the query so this works:
/_api/web/lists/getbytitle('Site%20Pages')/items?$select=Title,CanvasContent1,FileLeafRef
Другие советы
You can call the rest with this end point:
https://xxx.sharepoint.com/sites/xxx/_api/web/lists/getbytitle('Site Pages')/items
This will provide you with results of all information.
Не связан с sharepoint.stackexchange