A Token object has a token string and an authentication type.
Methods
Inherited methods
NSSPAuth$get_api_data()
NSSPToken$new()
Initializes a new Credentials object.
NSSPToken$get_api_response()
Get API response
Examples
myProfile <- Token$new("abc1234567890")
url <- "https://httpbin.org/json"
api_response <- myProfile$get_api_response(url)NSSPToken$get_api_graph()
Get API graph
Arguments
urla character of API URL
file_exta non-empty character vector giving the file extension. Default is
.png.
Examples
myProfile <- Token$new("abc1234567890")
url <- "https://httpbin.org/image/png"
api_data_graph <- myProfile$get_api_graph(url)
names(api_data_graph)
img <- png::readPNG(api_data_graph$graph)
grid::grid.raster(img)Examples
## ------------------------------------------------
## Method `NSSPToken$get_api_response()`
## ------------------------------------------------
if (FALSE) { # \dontrun{
myProfile <- Token$new("abc1234567890")
url <- "https://httpbin.org/json"
api_response <- myProfile$get_api_response(url)
} # }
## ------------------------------------------------
## Method `NSSPToken$get_api_graph()`
## ------------------------------------------------
if (FALSE) { # \dontrun{
myProfile <- Token$new("abc1234567890")
url <- "https://httpbin.org/image/png"
api_data_graph <- myProfile$get_api_graph(url)
names(api_data_graph)
img <- png::readPNG(api_data_graph$graph)
grid::grid.raster(img)
} # }