How to retrieve all SharePoint Online List Items using Rest API

We can fetch data from SharePoint in various ways - CSOM (client side object model), JSOM (JavaScript Object Model), Server Object Model, Graph API, Rest API.

REST API has been one of the most popular choice for developers. Major advantage is that REST is faster, universally accepted standard, platform independent.

With SharePoint, you can quickly test the REST call in your browser (try url from address bar) to check the returned response before actually using it.

REST API to get all items from SharePoint List/Document Library

Use GetByTitle('[List Name]')
This gets all list items from selected list
[Tenant] = name of your tenant
[SiteName] = Name of Site Collection / Sub site
[ListName] = Name of your SharePoint list

Get only selected column

Append ?$select=[Column Name]
This gets Title field value of all list items from selected list

Get multiple columns

Append ?$select=[Column Name 1,Column Name 2]
This gets Title and Date field value of all list items from selected list

You can further filter, order and sort columns in the REST query.
This link can be used with an AJAX function in your HTML and JQuery/JavaScript code to process and display the results ==> data.d.

The REST call will work with any language - .Net, JAVA, PHP, HTML, etc.

Topics Coverage:

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram