I`ve been working on a project to extract data from REST API.
I am able to connect to the server and get the token from my credentials. However, when I try to get a extraction following the examples provided I get the error message below:
'{"error":{"code":"d0dfbb58-c1a4-44a4-bc72-20d9af1c4b7b","message":"The controller for path \'/RestApi/v1/Extraction/ExtractionRaw\' was not found or does not implement IController. Error ID: [d0dfbb58-c1a4-44a4-bc72-20d9af1c4b7b]"}}'
Script:
import requests
header = {
'Prefer': 'respond-async, wait=5',
'Content-Type': 'application/json; odata.metadata=minimal',
'Authorization': tkn
}
data = {
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryRawExtractionRequest",
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [
{ "Identifier": "ABEV3.SA", "IdentifierType": "Ric" }
]
},
"Condition": {
"MessageTimeStampIn": "GmtUtc",
"ReportDateRangeType": "Range",
"QueryStartDate": "2021-07-22T12:00:00.000Z",
"QueryEndDate": "2021-07-26T12:10:00.000Z",
"ExtractBy": "Ric",
"SortBy": "SingleByRic",
"DomainCode": "MarketPrice",
"DisplaySourceRIC": True
}
}
}
urlExtraction = 'https://hosted.datascopeapi.reuters.com/RestApi/v1/Extraction/ExtractionRaw'
session = requests.Session()
session.headers=header
r = session.post(urlExtraction,data)
r.text
It would be great if anyone who knows what is happeing help me providing de solution for this.