RDP API Keeping the session open

HI,

I am using the RDP API to get bar data for several algos we are running. Until now my code work flow has been to Login, get bars, Logout. But I am running into Login limits, exceeding the allowable limits.

So I need to able to keep a session open and request bars as and when I need them from the same session.

Can you tell me what the mechanism is for refreshing a session token to allow it to stay open for multiple requests?

Not sure if the category is correct, couldn't find RDI API

Thanks

Best Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @gordon.konheiser

    Thank you for reaching out to us.

    Please check this article: Limitations and Guidelines for the RDP Authentication Service.

    After authenticating, an application will receive an access token with an expiration period. The access token can be used with other RDP endpoints to retrieve data.

    Therefore, instead of repeatedly getting a new access token, an application can reuse the previously retrieved access token with other RDP endpoints until it expires.

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @gordon.konheiser

    Before the session expires (based on the expires_in parameter, in seconds), an application needs to send request message to RDP Authentication service to get a new access token before further request data from the platform.

    The method is depending on which type of the Authentication that you are using. Are you using the Machine-ID (GE-A-XXXXXXXX-X-XXXX)/email-based username or Service-ID (GE-XXXXXXXXXXXX) username? (see the Account authorization V1 to V2 migration cheat sheet article).

    If you are using the Machine-ID/Email-based username:

    You can send a Refresh Token request message to the RDP Authentication Service V1 to get a new access token.

    The Refresh TokenHTTP request for the RDP APIs Authentication service is as follows:

    POST /auth/oauth2/v1/token HTTP/1.1
    Accept: */*
    Content-Type: application/x-www-form-urlencoded
    Host: api.refinitiv.com:443
    Content-Length: XXX

    refresh_token={current_refresh_token}
    &grant_type=refresh_token
    &client_id=RDP_APP_KEY

    Once the authentication success, the function gets access_tokenrefresh_token, and expires_in data from the RDP Auth service response message, the same as the initial RDP Authentication call. An application must keep those value for the next Refresh Token call.

    See section "Refreshing the Token" on the RDP APIs tutorial: Authorization - All about tokens page.

    If you are using the Service-ID username:

    You can send the same authentication request message with client-id and client-secret to the RDP Authentication Service V2 to get a new access token.

    The HTTP request for the RDP APIs Authentication service is as follows:

    POST /auth/oauth2/v2/token HTTP/1.1
    Accept: */*
    Content-Type: application/x-www-form-urlencoded
    Host: api.refinitiv.com:443
    Content-Length: XXX
    
    client_id=[service-id]
    &client_secret=[client-secret]
    &grant_type=client_credentials
    &scope=trapi
    &takeExclusiveSignOnControl=true
    

Answers