Dear Dev Community,
I'm currently facing issues when trying to use both the Eikon Python library and direct Web API calls in parallel. The Refinitiv application runs continuously in the background, and while the Python library functions work as expected, direct API calls fail with authentication issues.
Eikon Initialization
- The initialization is done using an API key from the environment variables (
EIKON_API_KEY
). - A proxy status check ensures that the Eikon proxy is active before proceeding.
- After successful initialization, a test API call verifies the connection.
- The Bearer token is automatically captured and stored.
Data Retrieval via the Python Library
- Functions like
ek.get_data()
and ek.get_symbology()
are used to retrieve data via the Eikon library. - These calls work consistently and return valid data.
Parallel Attempt: Direct API Calls to Refinitiv
- I am also trying to access Refinitiv data via direct Web API calls.
- A test endpoint was implemented to call:
https://api.refinitiv.com/user-framework/mobile/overview-service/v1/corp/filings/MBGn.DE
using the current Bearer token. - However, when testing via
curl
, I receive the following error:
{ "success": false, "message": "API request failed with status code: 401", "details": "{\"error\":{\"id\":\"44c34bb1-2cab-4b0a-a856-b059ec3c783e\",\"code\":\"401\",\"message\":\"token expired\",\"status\":\"Unauthorized\"}}\n"}
The error "token expired" suggests that the Bearer token may not be valid for direct API calls or requires a different handling process.
Additional Questions:
- Are the Bearer tokens for the Eikon Python library and Web API calls different? If so, how do they differ in terms of usage and expiration?
- How can I authenticate via Web API calls without logging out the local Refinitiv application? When I try to authenticate via OAuth or another method, the active session is terminated, which causes the Python library to stop working. Is there a way to prevent this?
- How can the token be refreshed for direct API calls without interrupting existing queries through the Eikon library?
- Are there alternative endpoints or methods to access the required company data?
Any insights or solutions would be greatly appreciated. Thanks in advance for your support! :)
Best regards,
Alex