EikonError: Error code 400 | Backend error. 400 Bad Request for data item "TR.ConsHoldPctPortfolio

I tried to send again a request including the "TR.ConsHoldPctPortfolio" variable, but it seems that the Eikon API still cannot return the required data (specifically for that variable). I tested this several times over the last 3 hours.


I tried replicating using the additional syntax, but to no avail. Could you please provide the complete syntax using Eikon API? (Please note that Client only have access to EIkon API, they don't have RDP API)


Here's my Code:


import refinitiv.data as rd

rd.open_session

config = rd.get_config()

config.set_param('apis.data.datagrid.underlying-platform', 'rdp')

df = rd.get_data(universe='LSEG.L',

fields='TR.ConsHoldPctPortfolio')


Best Answer

  • aramyan.h
    Answer ✓

    The client can also open two sessions, one going to RDP another the default udf by using the content layer of the library, see below:

    import refinitiv.data as rd
    from refinitiv.data.content import fundamental_and_reference
    session_1 = rd.session.Definition().get_session()
    session_2 = rd.session.Definition().get_session()
    config_session_1 = session_1.config
    config_session_1.set_param('apis.data.datagrid.underlying-platform', 'rdp')
    session_1.open()
    session_2.open()

    After defining, modifying and opening the sessions, we can pass the respective session object to the get_data function as below:


    response = fundamental_and_reference.Definition(
    universe='LSEG.L',
    fields='TR.ConsHoldPctPortfolio'
    ).get_data(session_1)

    response.data.df
    response = fundamental_and_reference.Definition(
    universe='LSEG.L',
    fields='TR.Revenue'
    ).get_data(session_2)

    response.data.df


    Hope this helps.


    Best regards,

    Haykaz

Answers

  • Hi @kristinekae.malig ,


    Please try calling open session after the config set up. First run the following cells:

    import refinitiv.data as rd
    config = rd.get_config()
    config.set_param('apis.data.datagrid.underlying-platform', 'rdp')
    rd.open_session()

    Only then, you can try on separate cell, call:

    df = rd.get_data(universe='LSEG.L', fields='TR.ConsHoldPctPortfolio')
    df

    Now it will use RDP service.

    screenshot-2024-08-12-at-104254.png


    Hope this helps.


    Best regards,

    Haykaz

  • e1.jpghi @aramyan.h I still got the same error -- pls see the screen shot below,

  • Hi, please try as shown below after restarting your kernel:


    screenshot-2024-08-12-at-113325.png

  • @aramyan.h thanks! it worked! -- So for this data item only, the client needs to do the ff syntax first to be able to download the data?


    import refinitiv.data as rd

    config = rd.get_config()

    config.set_param('apis.data.datagrid.underlying-platform', 'rdp')

    rd.open_session()

  • yes, that's correct