I tried to get files under "SitePages" document library in SharePoint site. "SitePages" folder has "webpart pages" type file wp.aspx and "sitepages" type file "sp.aspx". My request is
url: https://site_url/_api/web/getfolderbyserverrelativeurl(<folder_url>)/files
I am able to get wp.aspx but not sp.aspx. On further investigation i found out that sp.aspx is unpublished and saved as draft. If i publish sp.aspx i am able to get it from above API.
My question is how can we get unpublished files in above case using sharepoint rest api.