For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 0

Error while running market_price_edpgw_service_discovery.py example

I'm trying to run the market_price_edpgw_service_discovery.py example from here https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/EDP/python I pass the machine id and password on the command line as --user and --password respectively. The script successfully receives a token:

EDP-GW Authentication succeeded. RECEIVED: { "access_token":, "expires_in":"300", "refresh_token":"4ea872a3-****-c53c19a531aa", "scope":"", "token_type":"Bearer" }

Subsequently it attempts to get a set of hosts from a service discovery URL:

Sending EDP-GW service discovery request to https://api.edp.thomsonreuters.com/streaming/pricing/v1/

Which results in this error:

EDP-GW service discovery result failure: 403 Forbidden Text: {"error":{"id":"159b5daf-9260-4626-a46e-72565a35500d","code":"insufficient_scope","message":"access denied. Scopes required to access the resource [trapi. streaming.pricing.read]","status":"Forbidden"}}

Failed to retrieve endpoints from EDP Service Discovery. Exiting...

Any idea what is going on here? If I comment out the service discovery and websocket code, the authentication code successfully refreshes its token every 5 minutes as expected.

I believe I am on a kind of trial setup at the moment, while contracts are being finalised, if that makes a difference.

pythontreprdp-apiwebsocketsrrto
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.

@cilchmann, Refresh tokens are sensitive and long lived. I have masked it in your question.

@cilchmann

Thank you for your participation in the forum. Are any of the replies below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply that best answers your question. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

@cilchmann

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

-AHS

Upvotes
Accepted
25.3k 87 12 25

Hi @cilchmann

Looking at the error message details, it would appear your account does not have the correct entitlements/permissions i.e. it is missing trapi. streaming.pricing.read scope.

Is your trial account meant to include realtime streaming data access - or was it limited to other e.g. non-realtime data such as historical or news etc?

If you believe you should have realtime access, you need to ask your Refinitiv Account team to get your account amended to include the above scope.


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
22.1k 59 14 21

As @Umer Nalla pointed out, your account does not seem to have permission to invoke any API call. The scope parameter in response message is blank. Please contact your account manager.

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.