Error in call to API function "files/get_temporary_link": This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your API app key has team member file access permissions, you can operate on a team member's Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter to specify the exact user <https://www.dropbox.com/developers/documentation/http/teams>.
I'm trying to fix this issue. But how do you provide "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter here ? I tried to passed it to the URL authorize and access with /select_user/<TEAM MEMBER ID>.
This error raised on "drop_media" function, since authentification cannot provide Dropbox Business team access.
Any solution ?
Thanks ! 🙂
drop_auth_RT <- function (new_user = F, key = "########", secret = "#########", cache = TRUE, rdstoken = NA)
{
if (new_user == FALSE & !is.na(rdstoken)) {
if (file.exists(rdstoken)) {
.dstate$token <- readRDS(rdstoken)
}
else {
stop("token file not found")
}
}
else {
if (new_user && file.exists(".httr-oauth")) {
message("Removing old credentials...")
file.remove(".httr-oauth")
}
dropbox <- httr::oauth_endpoint(authorize = "https://www.dropbox.com/oauth2/authorize/?token_access_type=offline",
access = "https://api.dropbox.com/oauth2/token")
# added "?token_access_type=offline" to the "authorize" parameter so that it can return an access token as well as a refresh token
dropbox_app <- httr::oauth_app("V1_cdv2", "#####","######")
dropbox_token <- httr::oauth2.0_token(dropbox, dropbox_app,
cache = cache)
if (!inherits(dropbox_token, "Token2.0")) {
stop("something went wrong, try again")
}
.dstate$token <- dropbox_token
}
}
token<-drop_auth_RT()
saveRDS(token,"token.rds")
refreshable_token<-readRDS("token.rds")