rdp Error400 Bad Request for Vol Surface data quantitative-analytics-curves-and-surfaces

Hi All,

I am unable to retrieve data, I get error 400 "Bad Request". Here is my request:

    RESOURCE_ENDPOINT = "https://api.refinitiv.com/data/quantitative-analytics-curves-and-surfaces/v1/surfaces"

requestData = {
"outputs": ["Data"],
"universe": [
{
"surfaceTag": "Example Vol Surface",
"underlyingType": "Eti",
"underlyingDefinition": {
"instrumentCode": ".STOXX50E"
},
"surfaceParameters": {
"calculationDate": "2025-03-12",
"xAxis": "Tenor",
"yAxis": "Delta"
},
"surfaceLayout": {
"format": "List"
}
}
]
}

dResp = requests.post(url=RESOURCE_ENDPOINT, headers={"Authorization": "Bearer " + accessToken, "Content-Type":"application/json"}, params=requestData)

Please note that:

-I have a username, pwd, appKey that are set up

-I can retrieve that body using the same credencials within postman.

What is wrong with my request?

Best Answer

  • Sebastien_Bvrd
    Answer ✓

    I fixed it:

        RESOURCE_ENDPOINT = "https://api.refinitiv.com/data/quantitative-analytics-curves-and-surfaces/v1/surfaces"

    payload = json.dumps({
    "outputs": ["Data", "ForwardCurve"],
    "universe": [
    {
    "surfaceTag": "Example Vol Surface",
    "underlyingType": "Eti",
    "underlyingDefinition": {
    "instrumentCode": ".STOXX50E"
    },
    "surfaceParameters": {
    "calculationDate": "2025-03-12",
    "xAxis": "Tenor",
    "yAxis": "Delta"
    },
    "surfaceLayout": {
    "format": "List"
    }
    }
    ]
    })
    headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + accessToken
    }
    dResp = requests.request("POST", RESOURCE_ENDPOINT, headers=headers, data=payload)