We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
May 7, 2021 8:11 AM
I'm using the last version of HubSpot.NET API since 2 years without any problems.
Since some days my application stop working and nothing change on our custom properties field.
After some investigations I found that my application return an exception when it call CompanyProperties.GetAll();
HubSpot.NET.Core.HubSpotException was unhandled
HResult=-2146233088
Message=Error from HubSpot, JSONResponse=
RawJsonResponse=""
Source=HubSpot.NET
StackTrace:
at HubSpot.NET.Core.HubSpotBaseClient.SendRequest(String path, Method method, String json)
at HubSpot.NET.Core.HubSpotBaseClient.SendRequest[T](String path, Method method, String json, Func`2 deserializeFunc)
at HubSpot.NET.Core.HubSpotBaseClient.ExecuteList[T](String absoluteUriPath, Object entity, Method method, Boolean convertToPropertiesSchema)
at HubSpot.NET.Api.Properties.HubSpotCompaniesPropertiesApi.GetAll()
.........
Is something changed on your side ?
Can someone help me to find the problem ?
Thanks
Solved! Go to Solution.
May 10, 2021 8:31 AM
Finally I found a fix.
Before calling "api.CompanyProperties.GetAll()" on this specified Assembly (HubSpot.NET), I set the ServicePointManager protocols.
So my code look like this:
var api = new HubSpotApi(Program.Hapikey);
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;
var properties = api.CompanyProperties.GetAll();
May 10, 2021 8:31 AM
Finally I found a fix.
Before calling "api.CompanyProperties.GetAll()" on this specified Assembly (HubSpot.NET), I set the ServicePointManager protocols.
So my code look like this:
var api = new HubSpotApi(Program.Hapikey);
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;
var properties = api.CompanyProperties.GetAll();
May 7, 2021 3:35 PM
Hello @0divide
Adding @MichaelC and @danhammari to this topic to see if they have experienced anything similar.
![]() | Make sure to subscribe to our YouTube channel where you can find the HubSpot Community Developer Show |