sharepoint folder App permissions - Unauthorized

A python flask application I wrote is using the office 365 library to interact with our company sharepoint (in the 365 cloud).

I setup the below app permissions but https://xyz.sharepoint.com/sites/xxxyyyzzz/_api/Web/getFolderByServerRelativeUrl('sites%2Fxxxyyyzzz%2FFreigegebene%2520Dokumente%2FGeneral')/Folders" returns a 401 - Unauthorized error.

<AppPermissionRequests AllowAppOnlyPolicy="true">
  <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
  <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl"/>
  <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl"/>
      <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="FullControl"/>
      <AppPermissionRequest Scope="http://sharepoint/content/xyz" Right="FullControl"/>
</AppPermissionRequests>

This resolved to the following permissions:

  • Let it have full control of this site collection.
  • Let it have full control of this site.
  • Let it have full control of the list:
    • Documents
  • Let it share its permissions with other users.
  • Let it access basic information about the users of this site.

Other calls like uploading/downloading files are working but I cant get the list folder/ create folder/ to work. I also never found any other permissions or higher access levels in the documentation.

What am I missing?


Solution 1:

The 401 - Unauthorized error was very irritating, actually it was a problem with creating folder trees. The authentication worked using the Office365 python library.