API C# CompanyProperties.GetAll()

SOLVE
0divide
Participant

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

0 Upvotes
1 Accepted solution

Accepted Solutions
0divide
Solution
Participant

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();


View solution in original post

2 Replies 2
dennisedson
Community Manager

Hello @0divide 

Adding @MichaelC and @danhammari  to this topic to see if they have experienced anything similar.

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
0divide
Solution
Participant

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();


View solution in original post