ReinerM
ReinerM

Reputation: 7

Sharepoint Rest api: How i can get ServerRelativeUrl by item id

I like to use the rest API to breakroleinheritance of a folder. It works fine when you have the FolderServerRelativeUrl.

In my case i have only the itemID of the Folder. How i can get FolderServerRelativeUrl by item id. In the data of the Item i couldn't found it.

Thanks

Upvotes: 0

Views: 4656

Answers (1)

Vadim Gremyachev
Vadim Gremyachev

Reputation: 59358

At least the following options are available:

  • via FileRef property of ListItem resource: https://servername/_api/web/lists/getbytitle('<list title>')/items(<item id>)?$select=FileRef
  • or via ServerRelativeUrl property of Folder resource that is associated with a folder item: https://servername/_api/web/lists/getbytitle('<list title>')/items(<item id>)/folder?$select=ServerRelativeUrl

Upvotes: 1

Related Questions