Getting holdings statements using RDP API library

Hi,

I want to get holdings-statements data from the RDP API, using the .NET library, but I don't manage to get a successful response. The way I request data is:

EndpointRequest.Definition(url).Properties.BodyParameters((JObject)JToken.FromObject(holdingsStatementsRequest)).GetData();

Where holdingsStatements is the object I need to add to the body of the request, as described in the API Playground. The method is POST.
The url is: https://api.refinitiv.com/user-data/portfolio-management/v1/portfolio-analytics/{portfolioId}/holdings-statements

The response when I am executing the code is "Cannot
send a content-body with this verb-type.".
Can you give me a specific documentation or example where I can find how to use this endpoint that I want to use (.NET)?

Best Answer

  • Hello @andreea.ciforac

    To retrieve data using an Endpoint Definition with a POST, you could try the following example:

      var holdingsData = EndpointRequest
    .Definition(holdingsEndpoint)
    .BodyParameters(holdingsRequest)
    .Method(EndpointRequest.Method.POST)
    .GetData();

    The default HTTP method for the definition is GET. If your endpoint uses another one, you will have to specify it using the Method(). You can also specify the request body at the definition level using the BodyParameters(), which accepts a JObject instance.

    Thanks,

    Cristian