question

Upvotes
Accepted
1 0 1 1

Unable to run sample API from Windows

I am trying to run the sample code 'market_price_edpgw_service_discovery.py'. I have set the following variables:

user = 'MY_MACHINE_ID'

password = 'MY_PASSWORD'

I have also tried setting

client_secret = 'MY_PASSWORD'


However, I am receiving the below response:

Sending authentication request with password to  https://api.edp.thomsonreuters.com:443/auth/oauth2/beta1/token ...
EDP-GW authentication result failure: 400 Bad Request
Text: {"error":"access_denied"  ,"error_description":"Invalid username or password." } 
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.

Upvotes
Accepted
13k 32 12 18

Here is the EDP endpoints which are used for streaming data:

api.refinitiv.com

*.pricing.streaming.edp.thomsonreuters.com

It might help to setup a debugging proxy server like Fiddler to capture your raw HTTP request/response and compare. See the instructions here.

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.

@Ziemowit Kupracz, @graeme.taylor

Did the problem still occur in your environment? Did you have a chance to setup a debugging proxy server to test your request as suggested by Gurpreet?


Upvotes
13k 32 12 18

Hi @graeme.taylor, Your machine ID is usually alpha-numeric containing - and starts with GE. If that is what you are using, then please raise this issue with your account manager to get your credentials verified.

The client_secret variable is not used, and has to be blank.

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.

Upvotes
1 0 1 1

Hi @Gurpreet,


Yes, I am using my correct machine ID and password. I replaced them in snippet above due to public forum. Credentials have already been verified.

The response is identical with or without client_secret being set.


Thanks,`


Graeme

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.

It is obviously an issue with credentials, since the python sample works fine and is used by many of our clients. Unfortunately, I don't have any means of checking your permissions. I would recommend that you contact the account manager again.

The credentials have been tested by Ziemowit from Refinitiv and are ok. The main difference is I am running behind a proxy so have amended the request to pass in Proxy information.

Upvotes
1 0 0 0

@Gurpreet.

Hello,

The credentials themselves are fine - they have been tested with direct connection and worked. The cause is likely because the connection needs to go through proxy and that is when the example stops working.

Is there a documentation or example which shows how to handle proxy in Python?

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.

Upvotes
13k 32 12 18

@Ziemowit Kupracz, @graeme.taylor The error message that you have posted is coming from the EDP servers -- it demonstrates that the python sample is able to reach and successfully interact with EDP.

Here is the raw HTTP response I receive when using an invalid password:

HTTP/1.1 400 Bad Request
Date: Tue, 17 Sep 2019 18:14:14 GMT
Content-Type: application/json
Content-Length: 81
Connection: keep-alive
X-Amzn-Trace-Id: Root=1-5d812276-*****308bfcc879a
X-Served-By: region=us-east-1; cid=ddff84a6-****-76f03c517b90
X-Tr-Requestid: 5ed3******1602bb1

{"error":"access_denied"  ,"error_description":"Invalid username or 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.

Upvotes
1 0 1 1

It's possible that our proxy is stripping out the credentials. Can you give me a complete list of endpoints so I can ensure they are whitelisted from my end please?

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