question

Upvotes
Accepted
21 1 3 5

refinitiv.data not able to retrieve RDP access token (Error code 401)

Hello,

Recently I received Refinitiv Workspace and am using it instead of the old Eikon application. I am using the eikon and refinitiv.data API via Python. The eikon API works without any issue, however when I try to retrieve data using refinitiv.data I receive the error code 401 with the following message:
1700118338943.png

When opening a session using

import refinitiv.data as rd
rd.open_session()

I receive the output

<refinitiv.data.session.Definition object at 0x1c21cad3910 {name='workspace'}>

The _config_defaults.py looks like this:

1700119090749.png

I am actively running Refinitiv Workspace on my computer. The same issues arise when closing Refinitiv Workspace and logging into the Eikon application. The eikon API works in both cases.

Any help would be greatly appreciated!

pythonrefinitiv-dataplatform-eikon#technology#productrefinitiv-data-platformrefinitiv-data-platform-librariesrefinitiv-data-platform-eikonrefinitiv-data-librariesrefinitiv-dataplatform-libraries
1700118338943.png (45.3 KiB)
1700119090749.png (46.4 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.

Upvotes
Accepted
5.6k 18 2 7

Hi @benedikt-luka.antic ,


There is another question in the portal with the same issue and this is perhaps related to the Workspace App itself. I have already raised Product issue case with number 13094529.

You should have already received an email, please update us here with the progress.


Best regards,

Haykaz

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
5.6k 18 2 7

Hi @benedikt-luka.antic,


Do you receive this error after rd.open_session()? Please note that in RD you don't necessarily need to set up the config (If you want to use via config you need to provide your actual APP key under app-key field of the json) and pass the API key. When running rd.open_session() it will automatically pick up your APP key from Workspace desktop app running in the background.


Best regards,

Haykaz

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
21 1 3 5

Hi @aramyan.h,

No, when running rd.open_session() I receive the following, in my opinion 'normal', output

<refinitiv.data.session.Definition object at 0x1c21cad3910 {name='workspace'}>

Only when I then try to retrieve data do I receive the error outlined above after a couple of moments.

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.

Thanks @benedikt-luka.antic , can you please also share the code you are using which produces the error?

data = rd.discovery.search(

view=rd.discovery.Views.GOV_CORP_INSTRUMENTS,

top=10000,

filter=f"(DbType eq 'CORP' and RCSAssetCategory eq 'A:J' and IsActive eq true and (RCSFIClassificationCodes((Type eq 'ICMA') and (Code in ('IGBP' 'ISTP' 'ISBP' 'ISLP' 'ICTG'))) and IsESGBond eq true and FaceIssuedTotal gt 250000000 and (RCSCurrencyLeaf eq 'Euro' or RCSCurrencyLeaf eq 'US Dollar') and {sector_filter} {additional_sector_filter}))",

select="RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,InstrumentTypeDescription,RCSCouponTypeGenealogy,FaceIssuedUSD,RCSBondGradeLeaf,RCSFIClassificationCodes,IsESGBond,FaceIssuedTotal,RCSTRBC2012Leaf,RCSTRBC2012Genealogy",

)


sector_filter and additional_sector_filter are of course chosen accordingly beforehand. For testing purposes one could set:

sector_filter = "RCSTRBC2012Genealogy in ('B:262')"
additional_sector_filter = ''
Of course beforehand I execute
import refinitiv.data as rd
rd.open_session()

Hi @benedikt-luka.antic ,


Can you run other rd function, for example?

rd.get_data('AAPL.O')


Please also try if you have access in Search via our API Playground - API Playground (refinitiv.com).


And finally please post here what version of httpx are you using?


Best regards,

Haykaz

When I run

rd.get_data('AAPL.O')

I get the following error:
1700225461851.png


I have tried the API Playground and indeed have access in Search (as stated earlier these data requests were working without any issues until the recent installation of Refinitiv Workspace).


I am using the httpx version 0.24.1

1700225461851.png (15.1 KiB)

Thanks, I have already asked the team to check. May also ask you to run logs enabled and send me the logs in text file

import refinitiv.data as rd

rd.get_config().set_param(
    param=f"logs.transports.console.enabled", value=True
)
session = rd.open_session()
session.set_log_level("DEBUG")
rd.get_data('AAPL.O')

Best regards,

Haykaz

When I try to run this code, I receive the logs contained in the following text file: rd_logs.txt


(Twice an unexpected error occurred, which crashed my Refinitiv Workspace application, after I ran the code. I was not able to capture the error output, after I tried to reproduce it. It does not crash the application anymore.)

rd-logs.txt (8.5 KiB)
Upvotes
17.8k 82 39 63

Hi @benedikt-luka.antic

After launching LSEG Workspace, can you open a browser and try the following:

http://localhost:9000/ping?all

Your output should look something like this:

1700253632922.png

I'm looking to see if your account provides you with API access.


1700253632922.png (30.0 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.

Hi,

sadly the group policy at my work stops me from accessing http://localhost:9000/ping?all

But since all data requests have been working without trouble until recently and nothing regarding my actual account permissions etc. has changed, I would assume I still have API access.

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.