I am attempting to use R to automate pulling some views from our company's Sharepoint online. When I try to authenticate I get a 403 code with an error:
[1] "917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically."
I don't have this problem when authenticating to our Sharepoint on-premise.
The code that works for pulling from my on-premise site is:
url<- "https://xx.xx.xx/sites/RAH/Lists/RCA/AllItems.aspx"
test <- GET(url, authenticate("user", "pass", "any")
I've tried a few other ways as well such as:
test <- read.table(
text = getURL(
url,
userpwd = paste0("user", ":", "pass")
),
header = TRUE,
sep = ","
)
and
URL = "https://xx.xx.xx/sites/RAH/Lists/RCA/AllItems.aspx"
rawData = getURL(URL,userpwd="user:pass")
and both of those return an error
schannel: CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT
I have very little Sharepoint knowledge and experience. Anyone have any guidance on how to authenticate for me?
**Edit: We have an Excel app written in VBA that does this just fine but I don't know VBA and the the guy who wrote it will be retiring soon. Looking through his code it doesn't look like he has to authenticate at all, but I'm assuming that's because it's already been authenticated by being logged into 365. Again, not my wheelhouse I'm just taking guesses here.