GetFile with Id instead of Relative Url in Rest API

developer sp1 461 Reputation points

I know we can get file by relative url like this:


But now I want to get with Id like this:

/_api/web/GetFileById('<file unique id>')

I don't know how to get this file unique id can anyone help me please ?

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,567 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerryzy 10,561 Reputation points

    Hi @developer sp1 ,

    You can get the file guid using rest api like this:



    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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 comments No comments

0 additional answers

Sort by: Most helpful