I cannot get the market_price_rdpgw_service_discovery.py from website. Would you please send it t...

...o me for testing? Thanks.

I cannot get the market_price_rdpgw_service_discovery.py from website. Would you please send it to me for testing? Thanks.

1628505770061.png

Best Answer

Answers

  • Hello @susie.di

    It seems the example code encounters the issue during the authentication process with the RDP APIs Auth service.

    I am noticed that you are using the email-based username, not the Machine-ID. Please note that the RTO connections require the Machine-ID username type (GE-XXXXX). Did you get the Machine-ID from the Welcome email yet? I suggest you check the Welcome email again and try the step-by-step guide on the "Getting Start with the Machine ID" section of the Getting Started with Refinitiv Data Platform article.

    This old post also helps you regarding the difference between email ID (for RDP HTTP REST APIs) and Machine ID (for RTO connection).

    Once you have set up your Machine-ID, Password, and AppKey (aka Client_ID), you can test the credentials via the following cURL command or Python code.

    curl --location --request POST 'https://api.refinitiv.com/auth/oauth2/v1/token'; \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --header 'Authorization: Bearer ' \
    --data-urlencode 'username=<Machine ID>' \
    --data-urlencode 'password=<Password>' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'scope=trapi' \
    --data-urlencode 'takeExclusiveSignOnControl=true' \
    --data-urlencode 'client_id=<App Key>'

    or Python Code

    import requests

    reqUrl = "https://api.refinitiv.com/auth/oauth2/v1/token&quot;

    headersList = {
        "Accept": "*/*",
        "User-Agent": "Python",
        "Content-Type": "application/x-www-form-urlencoded" 
    }

    payload = "username=<Machine ID>&password=<Password>&client_id=<App Key>&grant_type=password&takeExclusiveSignOnControl=true&scope=trapi"

    response = requests.request("POST", reqUrl, data=payload, headers=headersList)

    print(response.text)


  • Hi @ngbmk

    Looking at the screenshot, the password is too short to be a MachineID password.

    did they click the link in the Welcome email and set the long password for the machineID?

    Please follow the instructions as per the link provided - Step 2 of the Welcome Email is the one where the long password is set.

  • Hi @susie.di and @ngbmk

    When posting screenshots etc, please remove machineIDs and email addresses - as well as passwords - this is a public forum.

  • Hi @ngbmk - I have deleted your last post as you included both machineID and user email address - both of which are client confidential information


  • Hi @ngbmk

    Please refer to the Getting Started with Refinitiv Data Platform article which my colleague linked previously - it provides detailed instructions.

    For RTO connection you need to use your MachineID - GE-A-xxxxxx with a long password set using the link in the Welcome Email as described in the above article.


  • ngbmk
    ngbmk Newcomer

    Hi @susie.di @umer.nalla

    i just use payload = "username=GE-A-xxxxxx&password=long password sent by Susie&client_id=babbxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&grant_type=password&takeExclusiveSignOnControl=true&scope=trapi" to test connection, it still show {"error":"access_denied" ,"error_description":"Invalid username or password." }

  • Hi @ngbmk

    I cannot confirm what the long password would be that Susie sent you. Normally the customer uses the link in the Welcome Email to set the long password.

    The error message you are seeing would indicate that the password is not valid.

    I have just tried to reset your password - so you should receive an email which should allow you to set the long password yourself.

    Please confirm if the email was received.

  • ngbmk
    ngbmk Newcomer

    umer.nalla

    i just sent the mail to you.