APIs & Integrations

0divide
Participant

API C# CompanyProperties.GetAll()

SOLVE

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
0divide
Solution
Participant

API C# CompanyProperties.GetAll()

SOLVE

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

0divide
Solution
Participant

API C# CompanyProperties.GetAll()

SOLVE

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


dennisedson
Community Manager
Community Manager

API C# CompanyProperties.GetAll()

SOLVE

Hello @0divide 

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

Thanks,

Dennis




HubSpot Community Developer ShowMake sure to subscribe to our YouTube channel
where you can find the HubSpot Community Developer Show
0 Upvotes