With the Umbraco Headless Client Nuget package I can query this endpoint using the Filter() method which accepts a ContentFilter object as parameter and returns a PagedContent object as the result. I want to filter content only of the type “character”, so I create the ContentFilter object passing in the content type alias “character” and an array of ContentFilterProperties.
For the ContentFilterProperties object I create and build a list of ContentFilterProperties type and add my filter property to the list.
My character content type has a “characterName” property. I want to filter all content where the characterName property value contains the search term. The search term in this instance is the name of the character which Dialogflow deciphers as the $person parameter value. So if the user asks for Hermione or Hermione Granger, it returns the details for Hermione Granger.
//create a HeartCore ContentDeliveryService object passing in the alias of the Heartcore instance
var cdnService = new ContentDeliveryService("heartcore-instance-name");
var filterProperties = new List<ContentFilterProperties>();
//create and add filter properties
filterProperties.Add(new ContentFilterProperties("characterName", searchTerm , ContentFilterMatch.Contains));
//filter out only the character content type
var filter = new ContentFilter("character", filterProperties.ToArray());
//call the Filter endpoint passing in the filter
var items = await cdnService.Content.Filter(filter);