question

Upvotes
Accepted
1 0 0 0

RDP get_data error insufficient scope

Hi,

I have a client trying to pull data via RDP API using Python. He is using rd.get_data and is getting the error below. He is able to retrieve data using get_history. Please advise how to fix.


rd.get_data(['/LSEG.L', '/VOD.L'])

No user scope for key=/streaming/pricing/v1/, method=GET.

Insufficient Scope. Cannot load the list of associated URLs from https://api.refinitiv.com/streaming/pricing/v1/ for apis.streaming.pricing.endpoints.main endpoint.

No user scope for key=/streaming/pricing/v1/, method=GET.

Insufficient Scope. Cannot load the list of associated URLs from https://api.refinitiv.com/streaming/pricing/v1/ for apis.streaming.pricing.endpoints.main endpoint.

Traceback (most recent call last):


Cell In[5], line 1

rd.get_data(['/LSEG.L', '/VOD.L'])


File C:\ProgramData\Anaconda3\lib\site-packages\refinitiv\data\_access_layer\get_data_func.py:126 in get_data

raise RDError(-1, except_msg)


RDError: Error code -1 | Error code -1 | Insufficient scope for key=/streaming/pricing/v1/, method=GET.

Required scopes: {'trapi.streaming.pricing.read'}

Available scopes: {'trapi.graphql.subscriber.access', 'trapi.metadata.read', 'trapi.data.symbology.advanced.read', 'trapi.search.explore.read', 'trapi.search.metadata.read', 'trapi.auth.cloud-credentials', 'trapi.cfs.claimcheck.read', 'trapi.search.lookup.read', 'trapi.data.historical-pricing.events.read', 'trapi.data.historical-pricing.summaries.read', 'trapi.data.symbology.read'}

Missing scopes: {'trapi.streaming.pricing.read'}

#technology#productrdppermissioning
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
7k 18 2 8

Hi @jasperngo.si ,


Do you know if the user has access to streaming data? The error suggest that the user is not permitted to access to the streaming prices.


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
27k 65 17 14

Hello @jasperngo.si

The Data Library - Python rd.get_data() function calls the RDP https://api.refinitiv.com/streaming/pricing/v1/ in the background for performing the endpoint service discovery.

The error message indicates that the client account does not have permission to access that https://api.refinitiv.com/streaming/pricing/v1/ endpoint because lack of 'trapi.streaming.pricing.read' scope.

I strongly suggest you contact the client's LSEG representative or Account Manager to verify and fix the client permission.

We, Developer Advocate team do not have a permission to set or change the client permission.

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
1 0 0 0

Thanks @aramyan.h and @wasin.w. Based on your answers, looks like client is not connecting to RDP using his Workspace ID. May I know how can user get streaming prices from RDP using his Workspace ID?

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
27k 65 17 14

Hello @jasperngo.si

The client can configure the library to use the Desktop Session (Workspace connection) via the refinitiv-data.configuration.json file (the file must be located in an application working directory).

{
    "logs": {
        "level": "debug",
        "transports": {
            "console": {
                "enabled": false
            },
            "file": {
                "enabled": true,
                "name": "refinitiv-data-lib.log"
            }
        }
    },
    "sessions": {
        "default": "desktop.workspace",
        "desktop": {
            "workspace": {
                "app-key": "<app_key>"
            }
        }
    }
}
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
7k 18 2 8

Hi @jasperngo.si ,


In addition to what my colleague suggested, I believe, the user may not still be able to get the access to streaming data if the scope 'trapi.streaming.pricing.read' is not assigned to the Workspace ID. So best would be to check also user permissions.


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
1 0 0 0

Thanks @aramyan.h and @wasin.w. This helps a lot.


Is there a way for client to access RDP API using his Workspace ID and permissions without having to login to Workspace everytime he runs the code?


Client has shared his codes below:

import os

os.environ["RD_LIB_CONFIG_PATH"] = "C:/Users/LimRu/Documents/scripts/Example.DataLibrary.Python-main/Configuration"

import refinitiv.data as rd

from refinitiv.data import session

import datetime

rd.open_session(config_name="C:/Users/LimRu/Documents/scripts/Example.DataLibrary.Python-main/Configuration/refinitiv-data.custom.config.json")

rd.get_data(['/LSEG.L', '/VOD.L'])

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

Hi @jasperngo.si ,


In order to use the API without having Workspace running on the background the client should connect via platform session (see the details on type of sessions here - Quick Start | Devportal (lseg.com)) which requires Machine ID and password on top of the APP Key. This requires an enterprise license which is something that I believe the Account Manager might help.


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
1 0 0 0

Thanks @aramyan.h

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.