Hi, I am trying to retrieve the components of a chain using the "/views/chains" API, the same example provided in the API Playground. My (Python) code and its output are below. Please let me know the likely cause of the error (error code 400, "Validation error"). Thanks very much. --Jon
Code:
import refinitiv.dataplatform as rdp
RDP_APP_KEY = ...
RDP_MACHINE_USERNAME = ...
RDP_MACHINE_PASSWORD = ...
RDP_BASE_URL = 'https://api.refinitiv.com'
RDP_CHAIN_URL = RDP_BASE_URL + '/data/pricing/beta3/views/chains'
CHAIN_UNIVERSE = '.AV.O'
rdp.open_platform_session(RDP_APP_KEY,
rdp.GrantPassword(RDP_MACHINE_USERNAME,
RDP_MACHINE_PASSWORD))
session=rdp.get_default_session()
url = RDP_CHAIN_URL + '?universe=' + CHAIN_UNIVERSE
ep = rdp.Endpoint(session=session, url=url)
response = ep.send_request(method=rdp.Endpoint.RequestMethod.GET)
if response.is_success:
print('[INFO] SUCCESS!')
# ...
else:
print('[ERROR] FAILURE!')
print('[ERROR] Error code: ' + str(response.error_code))
print('[ERROR] Error message: ' + response.error_message)
rdp.close_session()
Output:
[ERROR] FAILURE!
[ERROR] Error code: 400
[ERROR] Error message: Validation error