addpkg('DatastreamDSWS2R', '1.9.7')
library("DatastreamDSWS2R")
options(Datastream.Username = " ZXXX000") options(Datastream.Password = " PASSWORD123") mydsws <- dsws$new()Error in rjson::fromJSON(myTokenResponse) : no data to parse
@soham.sen1
Thank you for reaching out to us.
DatastreamDSWS2R is a third party library which isn't owned by LSEG. You may need to contact the owner to verify what the problem is.
You can check your credentials by using the TEST REST Service website.
Otherwise, you can use the following R code.
library(httr) DatastreamUsername <- "ZXXX000" DatastreamPassword <- "PASSWORD123" token_url <- paste("http://product.datastream.com/DSWSClient/V1/DSService.svc/rest/Token?username=", DatastreamUsername, "&password=", DatastreamPassword, sep="") test <- httr::GET(token_url, httr::timeout(300)) print(test) print(httr::content(test, as = "parsed"))
Thanks!