SOLVED

SharePoint access from third party application

Brass Contributor

Hello Community,

I'm writing to ask for a question regarding SharePoint Online access from third party application.

Basically I have a third party application written in Python (on-premise) needs to access to SharePoint online (read/write documents stored in a list) via REST API (or Microsoft Graph).

 

  1. Which is the best way ? REST API or Microsoft Graph ?
  2. Which are supported authentication types ? (It should be a server side authentication - no client side - so a, what is called, "Service Account" is preferable. 

Thank you,

Luca

 

 

2 Replies
best response confirmed by lucafabbri365 (Brass Contributor)
Solution
Graph is a framework, REST is the method you use to access Graph and although there are other ways to access SharePoint, I’ve found Graph to be the easiest and provides additional functionality that you can use to scale.

I’ve never done it from Python but even from C#, the Microsoft delivered packages do nothing more than call REST end points.

If you want to use a service principal, create an application in Azure and assign it the required application (not delegated) roles.

From there, start exploring the end points by using the documentation. These may help.

https://docs.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-1.0#sharepoint-api-r...

https://docs.microsoft.com/en-us/graph/auth-v2-service

https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0

Good luck!



@BradD,

thank you very much for useful information.

 

You are right, REST is an accessing method.

So as I discovered, another method is to use SharePoint REST API v1 (no Microsoft Graph) ?

Regarding authentication, if I use Service Principal with MSFT Graph, then I have to create an Azure app, but if I use SharePoint REST API v1, should I register Azure app too (link: Granting access via Azure AD App-Only) to use server-side auth. ?

 

Thank you again,

Luca

1 best response

Accepted Solutions
best response confirmed by lucafabbri365 (Brass Contributor)
Solution
Graph is a framework, REST is the method you use to access Graph and although there are other ways to access SharePoint, I’ve found Graph to be the easiest and provides additional functionality that you can use to scale.

I’ve never done it from Python but even from C#, the Microsoft delivered packages do nothing more than call REST end points.

If you want to use a service principal, create an application in Azure and assign it the required application (not delegated) roles.

From there, start exploring the end points by using the documentation. These may help.

https://docs.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-1.0#sharepoint-api-r...

https://docs.microsoft.com/en-us/graph/auth-v2-service

https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0

Good luck!



View solution in original post