Python DSS API extraction is giving be below error as malformed

Options
vivek.rajuluv01
edited August 4 in DSS

Code

def get_rics(token):
url=f"{BASE_URL}/Extractions/ExtractWithNotes"
headers={"Content-Type":"application/json","Authorization":f"Token{token}"
}
payload = {"ExtractionRequest":{
"@odata .type":
"#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentsListExtractionRequest",
"ContentFieldNames": ['RIC','DisplayName','ExchangeCode'],
"IdentifierList":{
"@odata .Type":
"#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentsList",
"InstrumentIdentifiers":[],
"ValidationOptions":{
"AllowHistoricalInstruments":True
},
"UseUserPreferenceForValidationOptions": False
},
"Condition":{
"DisplayName":{
"Contains":"2015"
},
"ExchangeCode":{
"Equals": "IEU"
}
}
}
}


Error Message
[Search] Response (first 500000 chars): {"error":{"message":"Malformed request payload: Unexpected @odata .type 'DataScope.Select.Api.Extractions.ExtractionRequests.DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentsListExtractionRequest' in payload"}}
[Search Error] Network or request failure: 400 Client Error: Bad Request for url: https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractWithNotes

Answers