New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
66 3 5 7

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 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
87.8k 294 53 79

@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 512.0 KiB each and 1.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)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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