Refinitiv API error with local jupyter notebook

When the following code is executed in CODEBK it works well, but in local jupyter notebook is running generating the variable dataframe = None.



import refinitiv.dataplatform as rdp

from refinitiv.dataplatform.content import ipa

from refinitiv.dataplatform.content.ipa import option

from refinitiv.dataplatform.content.ipa.models import BidAskMid

rdp.open_desktop_session('my app_key')

dataframe = rdp.get_option_analytics(

universe = ["FCHI700000C3.p", "FCHI675000O3.p"],

calculation_params = option.CalculationParams(

valuation_date="2023-01-26",

pricing_model_type = ipa.enum_types.PricingModelType.BINOMIAL

),)


print(dataframe)

Best Answer

  • @iguzman

    According to the error, it is unauthorized access. Please try to enable logging in the RDP library by using the method mentioned in this discussion.

    We need to verify that the error (401 Unauthorized) is from which endpoint or service.

Answers

  • @iguzman Thanks for your question and sorry to hear about your issue. I have tried as follows in a standalone jupyter notebook (ie not codebook) and all works fine please see below:

    import refinitiv.dataplatform as rdp
    from refinitiv.dataplatform.content import ipa
    from refinitiv.dataplatform.content.ipa import option
    from refinitiv.dataplatform.content.ipa.models import BidAskMid
    rdp.open_desktop_session('YOUR APP KEY HERE')
    dataframe = rdp.get_option_analytics(universe = ["FCHI700000C3.p", "FCHI675000O3.p"],calculation_params = option.CalculationParams(valuation_date="2023-01-26",pricing_model_type = ipa.enum_types.PricingModelType.BINOMIAL))

    print(dataframe)

    1675097377191.png


    Can you try my code above - run in 2 cells as indicated? Thanks in advance.

  • I tried your code and i have the following output:

    error.pngImage Caption

  • @iguzman

    You can enable logging in the RDP library by using the method mentioned in this discussion.

  • Hi thank yo for your answer, but it's not working.

  • 1675168199378.png


    rdp status is Unauthorized

  • @iguzman ok got it - so can I ask what version of the rdp library you are using?

    1675168960024.png

    This is version I am using and it works for me. Also what variant of Eikon/Workspace are you running? Thanks in advance.



  • my version is '1.0.0a20'


    1675169220804.png

  • @iguzman ok and your Eikon version - you can see this from the About item on the main Helios menu? thx
  • Version 1.19.448

    1675169776526.png