APIs & Integrations

JeanAMOROS
Participant

Use filters in the request body

 

HI,

I am developing in C # and trying to filter on the name of the company, but I get an error message back. Can someone help me

 


var clientR = new RestClient("https://api.hubapi.com/crm/v3/objects/companies/search?hapikey=" + Extension_HubSpot.Identification_HubSpot);
var requestRR = new RestRequest(Method.POST);
requestRR.AddHeader("cache-control", "no-cache");
requestRR.AddHeader("content-type", "application/json");
requestRR.AddParameter("application/json", "{\"filterGroups\":[{\"filters\":[{\"propertyName\":\"lastname\",\"operator\":\"EQ\",\"value\":\"IRMALT\"}]}]}", ParameterType.RequestBody);

IRestResponse responseRR = clientR.Execute(requestRR);

 

 

 

I have the following message
{"status":"error","message":"There was a problem with the request.","correlationId":"a5ccf758-d711-4da6-8ecd-a1c6133e66e5"}

 

0 Upvotes
1 Reply 1
dennisedson
HubSpot Product Team
HubSpot Product Team

Use filters in the request body

Hi @JeanAMOROS 

The json looks good.  Have you  tested in something like postman?

@gotmike , any thoughts?

0 Upvotes