I tried using it but it doesn't seem to work for me as i believe i have not entered the details accurately , please find below the request header along with the body and url and please let me know if it looks accurate for a scheduled request to extract price data
[For getting token and header]
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"
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
}
PROXY = {
'http':'http://proxy.jpmchase.net:10443'
, 'https':'http://proxy.jpmchase.net:10443'
}
[Body and Scheduled Price history extraction]
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",
"TimeZone": "Coordinated Universal Time",
"Recurrence":
{
"@odata.type": "#DataScope.Select.Api.Extractions.Schedules.SingleRecurrence",
"ExtractionDateTime": "2024-10-21T12:35:00.000",
"IsImmediate": "TRUE"
},
"Trigger":
{
"@odata.type": "#DataScope.Select.Api.Extractions.Schedules.ImmediateTrigger",
"LimitReportToTodaysData": "FALSE"
},
"InstrumentIdentifiers": [
{ "Identifier":"CNH=", "IdentifierType":"Ric" },
{ "Identifier":"CNY=", "IdentifierType":"Ric" },
],
"ValidationOptions": None,
"UseUserPreferencesForValidationOptions": "FALSE",
"Condition": None
}