APIs & Integrations

dmoverguz
Member

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

Hello,

 

I have a webhook that posts to my web api when a contact's first name is updated.  Nothing changes on my end and i believe the JSON sent over to my api is the same, but when I test by updating the contact's name, sometimes it works and returns 200 and other times it failes and returns Http 400.  Nothing is different on my end and I can't understand why the same post message would pass and then fail.  When it fails, all the retries fail as well.  Could someone please help?

 

Thanks,

 

Dmitriy

2 Accepted solutions
dmoverguz
Solution
Member

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

Hello, the issue was with our wrapper object's event id field being an integer.  Once we set it to long, the issue went away.  Apologies for the false alarm and thank you for your help.

 

Dmitriy

View solution in original post

0 Upvotes
dmoverguz
Solution
Member

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

@IsaacTakushi , Yes, I just posted this.  I saw your tests and I apologize for wasting your time.  I learned how to debug the web api while running it in azure web service earlier today and i found the issue that way.  It was intermittent, because the envent id field has a wide variance in its size and so sometimes it fit into an int field and others it was too large.  That's what caused the unevenness in reproduceability of the error.  But it works 100% now, after changing the data type to long.  Thank you!

View solution in original post

7 Replies 7
IsaacTakushi
HubSpot Employee
HubSpot Employee

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

Hi, @dmoverguz.

 

Happy to help.

 

Would you mind sending me links to some of these errors in your app's Monitoring page so that I can observe the behavior? Could you also specify the production Hub ID where these first name changes are occurring?

Isaac Takushi

Associate Certification Manager
0 Upvotes
dmoverguz
Member

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

@IsaacTakushi Thank you for your response!

I am attaching an image of one of the detailed error logs from azure app service that is hosting my web api application.  The Hub ID where the issue is occurring is: 5475696.  This isn't actually a production environment.  We are using it for development and that's where I installed my app and set up the webhook.  In webhook monitoring you can see the same requests succeeding some of the time and failing other times.  Http400Error.JPG

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

Hi, @dmoverguz.

 

Thanks for that information!

 

Did you change anything recently? I updated this test contact's firstname value ten times and the webhook notification was delivered successfully each time. I've attached a screenshot of the tenth notification below.

 

Successful firstname change notification.jpg

Isaac Takushi

Associate Certification Manager
0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

Hey, @dmoverguz!

 

Hahaha you must have been typing just as I was testing and drafting my response! I'm glad to hear you identified and resolved the issue!

Isaac Takushi

Associate Certification Manager
0 Upvotes
dmoverguz
Solution
Member

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

@IsaacTakushi , Yes, I just posted this.  I saw your tests and I apologize for wasting your time.  I learned how to debug the web api while running it in azure web service earlier today and i found the issue that way.  It was intermittent, because the envent id field has a wide variance in its size and so sometimes it fit into an int field and others it was too large.  That's what caused the unevenness in reproduceability of the error.  But it works 100% now, after changing the data type to long.  Thank you!

IsaacTakushi
HubSpot Employee
HubSpot Employee

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

Good to know. Thanks for the insight, @dmoverguz! You didn't waste anyone's time.

Isaac Takushi

Associate Certification Manager
0 Upvotes
dmoverguz
Solution
Member

Webhooks posting Contacts Update succeeds sometimes and returns Http 400 other times

SOLVE

Hello, the issue was with our wrapper object's event id field being an integer.  Once we set it to long, the issue went away.  Apologies for the false alarm and thank you for your help.

 

Dmitriy

0 Upvotes