Hi Lac, The status code means that you were not authorized to access the site, perhaps reflecting some problem with your syntax or your permissions. I note that attempting to simply go to the link to check on it gives status code 405, meaning the typical click on the hypertext is not an accepted method to access the location. Also consider the possibility that the site might be experiencing problems, so even if your syntax was correct it might not work right now. Another possibility is a change to URL syntax (addressing) at the precisely.com end, which appears to have been an issue, but I do not know if it still is.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 From: Lac Will<mailto:outlook_789d32266f1fd...@outlook.com> Sent: Tuesday, August 3, 2021 4:10 AM To: r-help@r-project.org<mailto:r-help@r-project.org> Subject: [R] Generate oauth token using HTTR package in R Novice attempting R, as displayed below, to obtain an oauth token using HTTR package in R and have a status code of 401. Any insight as to the cause of this error and a resolution? Thanks in advance. # Status: 401 library(httr) base64_value <- "123456789=" response16 <- httr::POST (url = "https://api.precisely.com/oauth/token" , httr::add_headers(Authorization = paste("Basic", base64_value, sep = "")), body = list(grant_type = "client_credentials"), encode = "form" ) #verbose(data_out = true, data_in = False, info = false, ssl = false) warn_for_status(response16) stop_for_status(response16) Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.