Accessing a sharepoint xlsx programmatically through R

I am currently trying to access a xlsx file present in company sharepoint drive.

URL <- "https://xxxx.sharepoint.com/:x:/r/sites/cqa/xxxx/_layouts/15/doc2.aspx?sourcedoc=%7BFxxx390-B71D-4C71-B252-6E3DCA8E9FDA%7D&file=Updated%20LXXal%20Reqxxxxents%20for%20XXXXX%20XXXX%20Actixxxx.xlsx&action=default&mobileredirect=true&cid=0abe8bcd-c785-4c14-a9f3-263e8e806aa6"

I read multiple links but none of them seem to work. Tried using httr::GET

require(httr)
url <- "above url"
r <- GET(url, authenticate("amit.sahoo@xxxx.com","password"))

But getting the below error response:

 Date: 2022-04-08 13:07
  Status: 403
  Content-Type: text/plain; charset=utf-8
  Size: 13 B

Tried using Microsoft365R::get_sharepoint_site("above url") but it shows "Need admin approval".

Is there any other direct way to read the file through R in a dataframe. Any suggestion would help. Asking this question in this community as i didn't receive any suggestion in the other communities.

can you access the resource with these same credentials outside of R, the message saying you need admin approval implies to me that you wouldn't be able to as you are not privileged to ?

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.