question

Upvotes
Accepted
3 0 0 1

Why am I getting an error when I run the exact same code in my stand-alone python environment, while it works using RDP API in the Codebook application in Workspace?

Asking on behalf of a client:


"I can access the data (end-of-day prices for EA.O) using the RDP API in the Codebook application in Workspace. Data comes back nice and tidy as per the request.

When I run the exact same code in my stand-alone python environment I get the error message below. It seems that I’m allowed access to the data via the API while in the WS Codebook app, but not via the API accessing it via my Python code.

Would it be possible to have the same rights using the API from my stand-alone code as in the WS Codebook app?

API error message:
Error for RIC EA.O:{'id': 'bf0701ae-c643-4f7b-b6bb-18133ebc77a0', 'code': 'insufficient_scope', 'message': 'access denied. Scopes required to access the resource: [trapi.data.historical-pricing.summaries.read]. Missing scopes: [trapi.data.historical-pricing.summaries.read]', 'status': 'Forbidden'}

Thank you for your assistance."


More information:

  1. Issue started yesterday. This is the first time I’ve used the refinitiv.dataplatform library in a stand-alone application, I’ve only used it in CodeBook in Workspaces before where it has worked every time.
  2. It happens every time I run the stand-alone application.
  3. Tried another RIC “ERICb.ST” with the same error message about insufficient_scope.
  4. Versions:
    1. Python 3.7.10
    2. Eikon 1.1.2
    3. Refinitiv 1.0.0a7.post7


pythonrdp-apirefinitiv-data-platform
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.

Upvote
Accepted
11.5k 16 7 10

Hello @arki.atienza

Based on my test, the Codebook uses my Workspace/Eikon credential which has different permission than the dedicated RDP credential.

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.

Upvote
39.2k 75 11 27

@arki.atienza

RDP Library can be used with Eikon/Refinitiv Workspace credentials as well as with RDP credentials. The latter is aimed at enterprise applications. In the case of Eikon/Refinitiv Workspace you're using a desktop session in RDP Library, whereby all data requests flow through Eikon/Refinitiv Workspace desktop application and which therefore has a runtime dependency on Eikon/Refinitiv Workspace desktop application. With RDP credentials you're using platform session in RDP Library. If you're using a desktop session you should have the exact same entitlements and similar experience between running the code in Codebook vs. running it in a Python interpreter on the machine alongside Eikon/Refinitiv Workspace. If you're using a platform session and different credentials from your Eikon/Refinitiv Workspace account, then it's expected that the entitlements may not be the same between these accounts. Are you using a desktop session, i.e. are you establishing a session using

import refinitiv.dataplatform as rdp
rdp.open_desktop_session('MY_APP_KEY')

or are you using a platform session, which you establish using

import refinitiv.dataplatform as rdp
rdp.open_platform_session(APP_KEY, 
                          rdp.GrantPassword(username = RDP_LOGIN, 
                                            password = RDP_PASSWORD ))
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.

Click below to post an Idea Post Idea