SharePoint REST API: Fetch File for FileId

Dhruvin Moradiya 55 Reputation points
2023-10-13T11:13:16.89+00:00

Hi,
I have scenario where, I want to fetch SharePoint Document library file for given fileId. Also, In my use case there is multiple fileIds(Array of fileIds).

Can we fetch details of files for multiple fileIds in single REST call, Instead of fetching details for single file.

Updated

I don't have item ids. I have UniqueId of SharePoint Document Library files. "UniqueId": "7a980f75-96a8-48f3-ac0b-3ee4bfbc744b". For my use can there can be 4k to 5K uniqueIds. I don't want to make individual call (Below on) to fetch these files.

/_api/web/GetFileById('UniqueId')?$expand=ListItemAllFields

I'm looking for a way to provide multiple uniqueIds and fetch multiple files in single call.

Thanks.

Microsoft 365 and Office SharePoint Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2023-10-16T03:04:49.3766667+00:00

    Hi @Dhruvin Moradiya,

    You could refer to following rest api to filter items by field. In the case, it's Modified time and ID.

    {siteUrl}/_api/web/lists/getbytitle('Employees')/items?$filter=(Modified le datetime'2023-10-26T09:59:32Z') and (ID eq 2)
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.