if (FALSE) {
session_details()
# If logged in, can use jossoSessionId for downloads.
authenticate_sb()
temp_json <- tempfile(fileext = ".json")
jsonlite::write_json(list(test = "test"), temp_json)
item <- item_upload_create(sbtools::user_id(), temp_json)
token <- session_details()$jossoSessionId
(base_url <- item$file[[1]]$downloadUri)
# will fail
try(jsonlite::read_json(base_url))
url <- paste0(base_url, "&josso=", token)
jsonlite::read_json(url)
item_rm(item$id)
}
Run the code above in your browser using DataLab