Asynchronus calls for search contacts api are not working
Asynchronus calls for search contacts api are not working. I am using asynchronus call, below is the code snippet. After exucuting the ".PostAsync" line process is stopping. Please suggest by seeing the below code snippet is really API support the async??
var client = new RestClient("https://api.hubapi.com"); var request = new RestRequest("crm/v3/objects/contacts/search", Method.Post); request.AddHeader("accept", "application/json"); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", $"Bearer {_token}"); var body = JsonConvert.SerializeObject(contactSearchRequest); request.AddParameter("application/json", body, ParameterType.RequestBody); var response = await client.PostAsync(request);
Asynchronus calls for search contacts api are not working
Hey, @hpolice👋 That's a good question. The documentation doesn't call this out as possible, so I do wonder. One question for you — have you tried wrapping your code in a try-catch block to see if any exceptions are being thrown?
Thanks! — Jaycee
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !
I have added try catch blocks, but no exeption found. It simply stoped my console application after execution of "var response = await client.PostAsync(request)" line;