6

I am looking to grant an application access to write to our SharePoint Online lists. We have Azure AD setup as an option. I don't want to prompt users for authentication/access, I want the app to get a token and then access SPO.

I got as far as creating the AAD App registration, and I can get the token from there, but I can't get into SharePoint. The App reg has Permissions to SPO

enter image description here

But my gut is that I need to allow this access in my site collection, and that's where everything goes dark. No idea where/how to do that. If I'm even on the right path.

UPDATE

I tried going down the Graph path, but to read/write list items is in Beta, and even that wasn't working, see other post https://stackoverflow.com/questions/44554169/access-sharepoint-sites-lists-via-microsoft-graph

2
  • have you looked at provider hosted apps with app-only token ? Jun 14, 2017 at 6:49
  • I haven't, this is a headless service accessing SP, doesn't fit the traditional app model. Jun 19, 2017 at 19:33

2 Answers 2

1

To access your SharePoint online site from any APP using preferred technology Microsoft Graph is the best way to do that.

Microsoft Graph exposes multiple APIs from Office 365 and other Microsoft cloud services through a single endpoint: https://graph.microsoft.com.

You can read below article to understand and get started.

Overview of Microsoft Graph API

Get Started with Microsoft Graph API

Working with SharePoint sites in Graph API

8
0

To write item sharepoint list your app should have below permission

Permission type Permissions- (from least to most privileged) Delegated (work or school account) -Sites.Manage.All Application- Sites.ReadWrite.All

Post URl: POST https://graph.microsoft.com/v1.0/sites/{site-id}/lists

POST /sites/{site-id}/lists Content-Type: application/json

{   "name": "customer list",   "columns": [
    {
      "name": "name",
      "text": { }
    },
    {
      "name": "address",
      "text": { }
    }   ],   "list": {
    "template": "genericList"   } }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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