question

Upvotes
Accepted
5 1 0 1

DSWS API R: Client error: (403) Forbidden

Hi team,

DSWS API R login receiving Client error 403.

(User ID: ZRBA041)


Error requesting data. HTTP message was: Client error : Forbidden : Client error: (403) Forbidden

Error in .self$.basicRequest(instrument = .self$symbolList[, 1], datatype = datatype, :

instruments is empty and has length zero

Can you advise what the issue is and how to resolve this?

Thank you.

datastream-apidsws-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
38.1k 69 35 53

@bob.kim

To verify the problem, you need to enable logging in DSWS API by using the following code.

mydsws$logging <- 5

You may also test the request on the Datastream Test REST Service.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you for your reply Jirapongse. Actually logging in is okay.

We are getting the above error message trying to run this.

When we changed Username it worked. Checked entitlements but they both were same.

Do you have any idea what may be the issue here?

(Password is x-ed out on purpose)



options(Datastream.Username = 'ZRBA041')

options(Datastream.Password = 'xxxxxxxxx')


# Load the library

library(DatastreamDSWS2R)


# Set the proxy

httr::set_config(httr::use_proxy(curl::ie_get_proxy_for_url("https://www.google.com"),

username = ":", password = ":",

auth = "gssnegotiate"))

proxy <- curl::ie_get_proxy_for_url("https://www.google.com")


Sys.setenv(https_proxy = proxy)


# Unset the proxy

# httr::set_config(httr::use_proxy(""))

# Sys.setenv(https_proxy = "")



# Create a DSWS API object to run queries

mydsws <- dsws$new()


# Make a small request

myData <- mydsws$timeSeriesListRequest(instrument = c("@:AUSP200"),

datatype = c("A12GRO","ALTMN"),

startDate = "31-01-2001",

endDate = "-0D",

frequency = "M")

@bob.kim

If changing the username works, you can check both usernames on the Datastream Test REST Service.

1615438430621.png (38.9 KiB)
Click below to post an Idea Post Idea