DSWS in RStudio - 403 error suddenly appearing

Options
Sunil_T
Sunil_T Newcomer
edited 8:27AM in Datastream

Hi I've used Datastream on excel quite a lot - trying out the API through Rstudio first time. The below code worked perfectly till about a day ago, but has now started generating errors as shown. Pardon the formatting that is messed up on copying code and output below. As you can see the error is appearing on the call to the snapshotRequest.

I haven't changed anything in the login credentials in the .Renviron file

A seperate question - should the username and password in the .Renviron file (DatastreamUsername and DatastearmPassword) be within quotes? (it worked with quotes earlier - now trying both with and without quotes - no luck eitherways)

> library(httr)
> library(devtools)
> library(DatastreamDSWS2R)
> httr::set_config(
                              httr::use_proxy(
                              url = Sys.getenv("proxy_url"),
                              username = Sys.getenv("proxy_user"),
                              password = Sys.getenv("proxy_pass")
                                                       )
                               )
> mydsws <- dsws$new()
> myData <- mydsws$snapshotRequest(instrument = c("U:F","U:BA","U:CAT","U:CVX","U:KO","U:XOM","@INTC" ,"U:JNJ","U:IBM"),
                                  datatype = c("NAME", "EXNAME", "GEOGN", "TR1N","TR2N","TR3N", "TR4N","TR5N"),
                                  requestDate = "0D")

Request failed [403]. Retrying in 1 seconds...
Request failed [403]. Retrying in 2.2 seconds...
Error requesting data.  HTTP message was: Client error : Forbidden : Client error: (403) Forbidden