Using NSW Data with R

How to read NSW Data using R. For example, to get an authorization token we tried the following:

id_secret <- base64(paste(client_id,client_secret,sep=":"))[[1]]
my_headers <- add_headers(
‘Authorization’=paste(“Basic”, id_secret, sep=" " ),
my_body <- ‘grant_type=client_credentials’
my_token <- POST(“”,
my_headers, body=my_body)

…but unfortunately without success.

it will depend on the API you are trying to access. which dataset are you trying to access?

Hi Jayen,
Thanks for your interest. We are trying to create an authentication token in R to access the NSW Fuel API as described on their website at:
We can get our token both using the NSW.DATA API page above and also using an independent API Tester but not yet in R alone. The R code above is useful in order to implement more frequent requests. Doing this manually each time is not viable. Appreciate the help.

© Data.NSW