I am trying to run a rest query to return the top three items from within a folder in a pages library, I have the code working however when I try to add an 'orderby' or 'top' parameter to the query it then stops working.
Just wondering if anyone could please provide me with any help on this.
This is how the query currently looks:
_spPageContextInfo.webAbsoluteUrl + "/_api/web/GetFolderByServerRelativeUrl('Pages/HomepageNews')/Files?$select=Author/Title,Title,ArticleByLine,TimeCreated,ServerRelativeUrl&$orderby=ArticleStartDate desc&$expand=Author,ListItemAllFields&$top=3"
I have even tried this in postman which returns an "InvalidClientQueryException" I cant figure out why this is not working.
Any help would be appreciated.