Hi all,
I'm am currently trying to use DSS via Python API. After running the code, I see that I am able to create a new instrument list, report template and schedule via my Python. However, I am than not able to retrieve the document with the data.
This is the code that I use for downloading the data:
while True:
response = requests.get(files_url, headers=headers)
response.raise_for_status()
files = response.json()
partial_files = [f for f in files['value'] if f['FileType'] == 'Partial']
if partial_files:
for file in partial_files:
file_id = file['ExtractedFileId']
file_name = file['ExtractedFileName']
file_url = f"{EXTRACTED_FILE_URL}('{file_id}')/$value"
file_resp = requests.get(file_url, headers=headers)
with open(file_name, 'wb') as f:
f.write(file_resp.content)
print(f"Saved partial data file: {file_name}")
break
else:
print("Waiting for partial data files...")
time.sleep(10)
I get the following error after awhile:
requests.exceptions.ConnectionError:
HTTPSConnectionPool(host='selectapi.datascope.refinitiv.com', port=443):
Max retries exceeded with url: ...
Caused by NameResolutionError: getaddrinfo failed
Does anyone know how to fix this issue? Many thanks in advance.