question

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

Hello @arki.atienza

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS


Upvote
Accepted
24.7k 54 17 14

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

Upvote
39.4k 77 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 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.