I have a bunch of images in a library that I need to get URLs for each item. I can get the GUIDs with this:


Is there a way to quickly get URLs for each item.

2 Answers 2


At least three options are available:

Option 1

Retrieve File Url via projected File object:

/_api/Web/Lists/getByTitle('<list title>')/items?$select=File/ServerRelativeUrl&$expand=File

Option 2

Retrieve File Url via FileRef property:

/_api/Web/Lists/getByTitle('<list title>')/items?$select=FieldValuesAsText/FileRef&$expand=FieldValuesAsText

Option 3

Retrieve files using GetFolderByServerRelativeUrl endpoint:

/_api/Web/GetFolderByServerRelativeUrl('<list url>')/Files?$select=ServerRelativeUrl 
  • How do you know what to put for $expand?
    – matt
    Oct 20, 2014 at 15:28

Assuming it's a Document Library, you can use $expand to bring information from the File along with the query

Should be something like this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.