SOLVED

SharePoint access from third party application

%3CLINGO-SUB%20id%3D%22lingo-sub-1622264%22%20slang%3D%22en-US%22%3ESharePoint%20access%20from%20third%20party%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622264%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Community%2C%3C%2FP%3E%3CP%3EI'm%20writing%20to%20ask%20for%20a%20question%20regarding%20SharePoint%20Online%20access%20from%20third%20party%20application.%3C%2FP%3E%3CP%3EBasically%20I%20have%20a%20third%20party%20application%20written%20in%20Python%20(on-premise)%20needs%20to%20access%20to%20SharePoint%20online%20(read%2Fwrite%20documents%20stored%20in%20a%20list)%20via%20REST%20API%20(or%20Microsoft%20Graph).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EWhich%20is%20the%20best%20way%20%3F%20REST%20API%20or%20Microsoft%20Graph%20%3F%3C%2FLI%3E%3CLI%3EWhich%20are%20supported%20authentication%20types%20%3F%20(It%20should%20be%20a%20server%20side%20authentication%20-%20no%20client%20side%20-%20so%20a%2C%20what%20is%20called%2C%20%22Service%20Account%22%20is%20preferable.%26nbsp%3B%3C%2FLI%3E%3C%2FOL%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3CP%3ELuca%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1622264%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622462%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20access%20from%20third%20party%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622462%22%20slang%3D%22en-US%22%3EGraph%20is%20a%20framework%2C%20REST%20is%20the%20method%20you%20use%20to%20access%20Graph%20and%20although%20there%20are%20other%20ways%20to%20access%20SharePoint%2C%20I%E2%80%99ve%20found%20Graph%20to%20be%20the%20easiest%20and%20provides%20additional%20functionality%20that%20you%20can%20use%20to%20scale.%3CBR%20%2F%3E%3CBR%20%2F%3EI%E2%80%99ve%20never%20done%20it%20from%20Python%20but%20even%20from%20C%23%2C%20the%20Microsoft%20delivered%20packages%20do%20nothing%20more%20than%20call%20REST%20end%20points.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20you%20want%20to%20use%20a%20service%20principal%2C%20create%20an%20application%20in%20Azure%20and%20assign%20it%20the%20required%20application%20(not%20delegated)%20roles.%3CBR%20%2F%3E%3CBR%20%2F%3EFrom%20there%2C%20start%20exploring%20the%20end%20points%20by%20using%20the%20documentation.%20These%20may%20help.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fsharepoint%3Fview%3Dgraph-rest-1.0%23sharepoint-api-root-resources%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Fsharepoint%3Fview%3Dgraph-rest-1.0%23sharepoint-api-root-resources%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fauth-v2-service%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fauth-v2-service%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Foverview%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Foverview%3Fview%3Dgraph-rest-1.0%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EGood%20luck!%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1622488%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20access%20from%20third%20party%20application%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1622488%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F702117%22%20target%3D%22_blank%22%3E%40Brad_Dixon%3C%2FA%3E%2C%3C%2FP%3E%3CP%3Ethank%20you%20very%20much%20for%20useful%20information.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20are%20right%2C%20REST%20is%20an%20accessing%20method.%3C%2FP%3E%3CP%3ESo%20as%20I%20discovered%2C%20another%20method%20is%20to%20use%20%3CA%20title%3D%22SharePoint%20REST%20API%20v1%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsp-add-ins%2Fget-to-know-the-sharepoint-rest-service%3Ftabs%3Dcsom%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESharePoint%20REST%20API%20v1%3C%2FA%3E%20(no%20Microsoft%20Graph)%20%3F%3C%2FP%3E%3CP%3ERegarding%20authentication%2C%20if%20I%20use%20Service%20Principal%20with%20MSFT%20Graph%2C%20then%20I%20have%20to%20create%20an%20Azure%20app%2C%20but%20if%20I%20use%20SharePoint%20REST%20API%20v1%2C%20should%20I%20register%20Azure%20app%20too%20(link%3A%26nbsp%3B%3CA%20title%3D%22Granting%20access%20via%20Azure%20AD%20App-Only%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fsolution-guidance%2Fsecurity-apponly-azuread%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGranting%20access%20via%20Azure%20AD%20App-Only%3C%2FA%3E)%20to%20use%20server-side%20auth.%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20again%2C%3C%2FP%3E%3CP%3ELuca%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional 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
Highlighted
Best Response confirmed by lucafabbri365 (Occasional 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!



Highlighted

@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