APIs & Integrations

Bruno_Thomaz
Member

.Net Timeout in every request

Hello,

I'm doing a simple POST request to create an engagements, but every request is returned as timeout, I don't know why this is happening, the code is in .Net Framwork 4.6 using HttpClient

0 Upvotes
9 Replies 9
IsaacTakushi
HubSpot Employee
HubSpot Employee

.Net Timeout in every request

Welcome, @Bruno_Thomaz!

Happy to help. To troubleshoot effectively, though, I'll need a bit more information. Would you share:

  1. Your Hub ID.
  2. The full request URL you used, including the method. (Do not include your API key.)
  3. The raw request body, including the headers.
  4. The full error you received from HubSpot, including the status code.

Isaac Takushi

Associate Certification Manager
0 Upvotes
HudsonRomeu
Member

.Net Timeout in every request

Hi @IsaacTakushi , I'm with the same problem when runs Get or Post on hubspot api.

Above the url that I tryied consume:

https://api.hubapi.com/crm/v3/objects/companies?hapikey={apikey}.

 

The timeout occurs only on C#.Net HttpClient or WebClient request. In postman or browser the api returns a succefuly response. 

 

The exception occurs using Hubspot.Net (community api) and self HttpClient.

 

1. My Hub ID:  7831362

2. The full request url: https://api.hubapi.com/crm/v3/objects/companies?hapikey={apikey}.

Method: GET

3. No Headers except the default from .net

4. hubspoterror.png

 

Thanks a lot for any help!

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

.Net Timeout in every request

Welcome, @HudsonRomeu.

 

Thanks for reaching out. I'm happy to try and help.

 

First, can you confirm that you've created company records in account 7831362? I know it sounds silly, but I want to rule that out as a factor.

 

Second, to clarify, you say:

The timeout occurs only on C#.Net HttpClient or WebClient request[s].

Does this mean you have gotten other C#.Net requests to succeed? For example, using the RestSharp client library?

 

If you haven't tried requests with RestSharp yet, would you mind trying something like the following to help isolate the issue?

 

var client = new RestClient("https://api.hubapi.com/crm/v3/objects/companies?hapikey=YOUR_KEY");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

If that does not work and you don't have working C# code, could you share what you do have so that I can examine your implementation more closely? If you'd rather not post here, feel free to direct message me.

Isaac Takushi

Associate Certification Manager
0 Upvotes
HudsonRomeu
Member

.Net Timeout in every request

Hi @IsaacTakushi,

First yes, I've created companies before on my account. But I remove that, the problem is my requests don't finish on endpoint. After consult my requests log, I can't see my old requests there.

 

Second, I've tryied  Restsharp too and occurs the same issue. 

 

About my code, I'll post on my git account and send to if you could check please.

Thanks a lot.

0 Upvotes
HudsonRomeu
Member

.Net Timeout in every request

@IsaacTakushi ,

above the github link, the cause maybe be a quote limit? 

 

https://github.com/HudsonRomeu/hubspot_client

0 Upvotes
HudsonRomeu
Member

.Net Timeout in every request

Mr. @IsaacTakushi, now it works. The same code. 

I didn't understand way, but I'm affraid that it occurs on production. 

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

.Net Timeout in every request

Hi, @HudsonRomeu.

 

Thank you for sharing all of this information.

 

To clarify, when you say, "the cause maybe be a quote limit?", are you referring to a possible quota or rate limit?

 

If you ran into a HubSpot rate limit, I would expect a 429 error response rather than a silent timeout, so I'm not confident that is the issue.

 

Regarding your last point, are you saying that one-off or QA tests began to work with this code, but that the same code fails in production?

 

I'm curious, do requests to other APIs also time out? For a quick test, you could make a GET request to https://reqbin.com/echo.

Isaac Takushi

Associate Certification Manager
0 Upvotes
HudsonRomeu
Member

.Net Timeout in every request

Hello @IsaacTakushi,

Another endpoints don't ocorrus errors. I solved the issue using another internet provider. I just don't know why it crashed on my another internet ip.

 

But thanks for all help.

 

I have another question about hubspot: 

My users generated a task by registered calls. The problem is about the subject of my task. 

It's possible after register a call, the call description go to my new task? 

IsaacTakushi
HubSpot Employee
HubSpot Employee

.Net Timeout in every request

Hi, @HudsonRomeu.

 

I'm glad to hear you resolved the timeout issue.

 

Tasks are a type of engagement, so they can certainly be created and updated with the Engagements API.

 

Can you tell me a little more about how these tasks are created? Are you using this API or using HubSpot automation (workflows) to create tasks after calls are logged?

 

 

Isaac Takushi

Associate Certification Manager
0 Upvotes