Forum Discussion

009co's avatar
009co
Helper IV
4 years ago
Solved

SharePoint.Files vs SharePoint.Contents - shared folder auth works for Files but not Contents

I have been using SharePoint.Files to connect to another person's OneDrive which has folders shared with me uisng the following connection:

 

= SharePoint.Files("https://my_company.sharepoint.com/personal/other_person_name/", [ApiVersion = 15])

 

This works. I am able to authenticate and access only the shared folders using my credentials. I can see all of the folders shared with me and access their content.

 

However, when I tried using SharePoint.Contents to access the same shared OneDrive content, it doesn't accept the same authentication used for SharePoint.Files.


= SharePoint.Contents("https://my_company.sharepoint.com/personal/other_person_name/", [ApiVersion = 15])

 

Is this expected behavior? I expected that would be able to authenticate and see only the shared folders and be able to navigate to the folder I wanted and get content.

 

Ideas?

 

Edited to add:

I am using "Microsoft account" authentication in both connections.

5 Replies