Forum Discussion

Tarundeep's avatar
Tarundeep
Copper Contributor
Feb 25, 2019
Solved

How to get all pages under "sitePages" using SharePoint REST API in modern sites ?

I have created number of pages under "/SitePages" and want to retrieve them using SharePoint REST API.

The below one's doesn't work

_api/web/lists/getbytitle('SitePages')/Items

_api/web/lists/getbytitle('Pages')/Items

 

  • Got It -- Resolved --

    /_api/Web/Lists(guid'SomeGUID')

    /_api/Web/Lists(guid'SomeGUID')/Items(19)?$select=ID,Title

4 Replies

  • NotAlex's avatar
    NotAlex
    Iron Contributor

    _api/web/lists/getbytitle('Site Pages')/Items

     

    With a space as its looking for the Title not url :)

     

    Cheers

  • Tarundeep's avatar
    Tarundeep
    Copper Contributor

    Got It -- Resolved --

    /_api/Web/Lists(guid'SomeGUID')

    /_api/Web/Lists(guid'SomeGUID')/Items(19)?$select=ID,Title

      • Sayannara's avatar
        Sayannara
        Copper Contributor

        Kumar0001 

        Spoiler
        Hello,

        here is my function for this

        https://github.com/Sayannara/SPO/blob/master/Get-SPSitePagesContent.ps1

Resources