Accessing Sharepoint Files with httr

This question has been asked before here but didn't receive an answer. I'll be receiving ~150 files and want to automate reading them into R. I can access them from a mapped folder but Sharepoint would be easier as it contains information about who sent the file.

When I use the following:

    authenticate("username", "password"),
    write_disk("Data_Collection/tempfile.xlsx", overwrite = TRUE)

it creates the tempfile with this message in the console:

Response []
  Date: 2020-10-01 12:50
  Status: 403
  Content-Type: text/plain; charset=utf-8
  Size: 13 B
<ON DISK>  C:\Users\Data_Collection\tempfile.xlsx

When I open the file, I get this error:

I know status 403 means the server recognized the request and refuses to authorize. How can I get around this?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.