I tried setting up my code to get the price at 8:30 AM UTC but it doesnt seem to work, could you please help me with it
Code
token_url = "https://selectapi.datascope.refinitiv.com/RestApi/v1/Authentication/RequestToken"
payload = "{\r\n "Credentials": {\r\n "Username": "9038135",\r\n "Password": "***********"\r\n }\r\n}"
scheduled_price_url="https://selectapi.datascope.refinitiv.com/restapi/v1/Extractions/Schedules"
headers = {
'Prefer': 'respond-async',
'Content-Type': 'application/json'
}
PROXY = {
'http':'http://proxy.jpmchase.net:10443'
, 'https':'http://proxy.jpmchase.net:10443'
}
try:
response = requests.request("POST", token_url, headers=headers, data=payload,proxies = PROXY,verify=False)
print("Successfully connected")
data=response.json()
token=data.get("value")
scheduled_price_header={
'Prefer': 'respond-async',
'Content-Type': 'application/json',
"Authorization": "Token "+token
}
body={"Name": "TEST Sample EOD Extraction_3", "TimeZone": "Coordinated Universal Time", "Recurrence": { "@odata .type": "#DataScope.Select.Api.Extractions.Schedules.SingleRecurrence", "ExtractionDateTime": "2025-08-08T08:30:00.000Z", "IsImmediate": "TRUE" }, "Trigger": { "@odata .type": "#DataScope.Select.Api.Extractions.Schedules.ImmediateTrigger", "LimitReportToTodaysData": "TRUE" }, "ListId": "0x097f476f72eb43f0", "ReportTemplateId": "0x097a61595a9b3b46" }response_close_price=requests.request("POST", scheduled_price_url, headers=scheduled_price_header,json=body, proxies = PROXY,verify=False).json()print(response_close_price)
except requests.RequestException as e:
print(f"Couldnt connect : {e}")
End of Code
Also it seems to throw an error that scheduled already exists and i need to rename it every time i run, maybe this is a one time thing and i need to write some more code to get the actual price could you please help