Skip to main content

Microsoft Graph API and SharePoint


While developing solutions for office 365 Microsoft graph API will help you in achieving the required output.

In my previous project where I have used Graph API, I found it difficult for getting info on some of the endpoints. Below I will try to list out some of the basic and most used end points of Microsoft graph API for SharePoint.

Getting site level information

Searching for Sites
it returns the list of site collections the user have permission.

Site details based on the relative path
if the site collection url is https://contoso.sharepoint.com/sites/test1
Host-name:- contoso.sharepoint.com
Server relative path:- sites/test1

Different ways to get list data

Get the list data for a root site

Get the list data for a relative site collection
for example if you want to fetch the details of the list with the name list1

Getting all the fields of a SPList item

For getting all the fields of a list item we need to use the expand query parameter.  
For a root site collection

For a site collection with a relative url

Batch Requests in Graph API

Using the Batch request we can combine multiple requests for graph api as single request. Each request is tracked with an ID and response will be returned with the same ID. Batch request can be a combination of both get and Post requests.
Method: Post
Request JSON format :


Structure of a Batch Request JSON

Comments