0
votes

I am looking to fetch SP data using sharepoint Folder based Rest api. When i use filters, it is taking long time (close to one minute) to fetch the data. when i use pages rest api instead of folder level, that is faster. But my need is to hit the folder api. Any help would be appreciated.

Example: this is faster - https://sharepoint.com/sites/mysite/_api/Web/Lists/ GetByTitle('pages')/items?$ select=field1,field2,field3&$orderby=field5&$filter=field6&$top=10

This is slow - https://sharepoint.com/sites/mysite/_api/web/ GetFolderByServerRelativeUrl('pages/myfolder')/files?$select=ListItemAllFields/field1,ListItemAllFields/field2, ListItemAllFields/field3&$orderby=field5&$filter=ListItemAllFields/field6&$top=10

Do i need to change the way i am querying the folder to improve the performance?

1

1 Answers

1
votes

If you are using SharePoint Online, you can use Microsoft Graph API for improved performance.

To get the files in the folder you can use below endpoint.

/me/drive/root:/path/to/folder:/children

I would suggest, you try your queries in Microsoft Graph explorer

You can get further guidance here