question

Upvotes
Accepted
1 0 0 0

DSWS REST API

I'm attaching a screenshot but also here's the full details of the issue as well:


We're using the DSWS REST API. While trying to troubleshoot in case it was some of our code causing the issue, we tried multiple alternatives.

We tried the Python package https://github.com/datastreamapi/DatastreamPy as mentioned on https://developers.lseg.com/en/api-catalog/eikon/datastream-web-service, without any luck, resulting in the same error.

We also tried pure manual HTTPS requests to the same REST API specifically
1. Get auth token: https://product.datastream.com/DSWSClient/V1/DSService.svc/rest/Token?username=...&password=...

2. Get data using the above auth token https://product.datastream.com/DSWSClient/V1/DSService.svc/rest/Data?token=...&instrument=VOD&datatypes=PL%2cPH&datekind=TimeSeries&start=-30D&end=-25D&freq=D

The (1) auth token is returned successfully (HTTP code 200), but (2) fails to return the data and instead returns HTTP code 401 with the following response:

{
"Code": "InvalidCredentials",
"Message": "User ZEID052 access temporarily suspended. Access suspended whilst investigating end user . Please contact your LSEG representative",
"SubCode": null
}


and some headers of a sample problematic reponse:

X-Ds-Server: DSWP12

Date: Fri, 26 Jul 2024 16:44:46 GMT-18m 3s

X-DS-VIP: DS_Web_Prod_EXT-443

X-DS-TimeTaken: 3 ms

X-DS-URID: 1722012287719287366120319


screenshot-from-2024-07-26-21-05-40.png



#productdatastream-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.

Upvotes
Accepted
84.6k 287 53 77

@RALPHPAOLO.NAVARRO

Thank you for reaching out to us.

According to the error message, your account has been suspended.

You can contact the Datastream Web Service support team directly via MyAccount to verify what the problem is.

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.

Upvotes
6.8k 21 3 6

Hi @RALPHPAOLO.NAVARRO , may I ask: which data field were you after? I'm asking because on my end I can make things like this work:


import DatastreamPy as DSWS

# We can use our Datastream Web Socket (DSWS) API keys that allows us to be identified by
# Refinitiv's back-end services and enables us to request (and fetch) data:
# Credentials are placed in a text file so that it may be used in this code without showing it itself.
(DSWS_username, DSWS_password) = (
    open("Datastream_username.txt","r"),
    open("Datastream_password.txt","r"))

ds = DSWS.Datastream(
    username = str(DSWS_username.read()),
    password = str(DSWS_password.read()))

# It is best to close the files we opened in order to make sure that we don't stop any other
# services/programs from accessing them if they need to.
DSWS_username.close()
DSWS_password.close()


# # Alternatively one can use the following:
# import getpass
# dsusername = input()
# dspassword = getpass.getpass()
# ds = DSWS.Datastream(username = dsusername, password = dspassword)

df = ds.get_data(
    "VOD",
    ['PL'],
    start = '2013-08-31',
    kind = 1)

1722286077982.png


1722286077982.png (37.7 KiB)
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.

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.