Sharepoint Get File by Id

Harsha Vardhini 25 Reputation points

I have used the api __https://{tenant}'<unique-file-id>') __to get the details of a file using the siteName and the unique file id

This works for Sharepoint Online. Will this work for all sharepoint on-prem and online accounts. And if possible could I get the official documentation for this api.

Thanks in Advance

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,908 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,850 questions
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 32,246 Reputation points Microsoft Vendor

    Hi @Harsha Vardhini,

    The api should contain list name or list id. You can refer to following api

    GET https://{site_url}/_api/web/lists/GetByTitle('Test')/items({item_id})
    Authorization: "Bearer " + accessToken
    Accept: "application/json;odata=verbose"

    Here is the document for reference

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful