question

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

Hello @graeme.taylor,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

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

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 512.0 KiB each and 1.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
22.1k 59 14 21

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

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

Hello @Ziemowit Kupracz,

Would like to confirm, to be 100% sure that not only the credentials that you have are valid, but also are the right creds to use with ERT.

The user starts with "GE" characters and is not your email, the password is fairly long, over 20 chars, special ERT password?

The reason to double-check is your error is on username and password combo.

Upvotes
22.1k 59 14 21

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

Upvotes
1 2 2 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 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.