question

Upvotes
Accepted
1 0 0 2

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)

eikonworkspace#technologyrefinitiv-data-platformrefinitiv-dataplatform-libraries
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.

<private post>

Hi @iguzman ,

Could you please provide the information required by my colleague (Jirapongse) in the comment section below

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.

Hello @iguzman

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar 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
78.8k 250 52 74

@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.

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
10.2k 18 6 9

@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.


1675097377191.png (212.9 KiB)
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 0 0 2

I tried your code and i have the following output:

error.pngImage Caption


error.png (16.7 KiB)
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.

@iguzman

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

Upvotes
1 0 0 2

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

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 0 0 2

1675168199378.png


rdp status is Unauthorized


1675168199378.png (20.4 KiB)
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
10.2k 18 6 9

@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.




1675168960024.png (20.3 KiB)
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 0 0 2

my version is '1.0.0a20'


1675169220804.png


1675169220804.png (2.4 KiB)
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.

@iguzman ok and your Eikon version - you can see this from the About item on the main Helios menu? thx
Upvotes
1 0 0 2

Version 1.19.448

1675169776526.png


1675169776526.png (63.7 KiB)
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.