APIs & Integrations

Walter_Anderson
Member

Ecomm Bridge - Sync Messages API not receiving messages intermittently

SOLVE

(Hub ID: 2252779)

I'm trying to figure out some weird behavior I'm seeing regarding the Ecommerce Bridge Sync Messages API. For context, the issue I'm having is regarding a script I wrote to send Hubspot our historical e-commerce data.

Initially it appeared as though the script worked as expected. Upon further inspection though I noticed there are large and small gaps of data missing. For example, data from January 2016 is missing, but some (not all) data from March 2016 is there. Most of the data from 2017 is missing. I have run this script multiple times (narrowing down on the date range so I'm only sending sync messages for the missing records) and I'm seeing the same results.

When I inspect a record from one of these missing chunks of time using the new sync-status endpoint, it appears as though Hubspot never even received a message for it. I've cleaned up and optimized the script I'm using and everything appears to be working as expected on my end, so I'm drawing a blank on what the root cause could be. The sync message has been sent but apparently not received.

For additional context, this script is sending sync messages for CONTACT, DEAL, and LINE_ITEM object types, and it's batching these messages in chunks of 200.

Is there anything that could be silently preventing these deals from getting created? Is there a limit on the number of deals you can create? Any additional help in finding a solution would be much appreciated.

Thanks!

0 Upvotes
1 Accepted solution
Walter_Anderson
Solution
Member

Ecomm Bridge - Sync Messages API not receiving messages intermittently

SOLVE

Hey Issac, thanks for the response.

In typical developer fashion, as soon as I submit the post I find some new information that helps diagnose the issue. Your questions definitely helped me get there as well, so thank for you that.

My primary issue was with my reporting logic, which resulted in some of the Hubspot responses being suppressed. So of course once I had an error message to work with, I found the bug in my sync script.

For posterity, the error was a 400 validation error:

{
  "status": "error",
  "message": "Invalid input JSON on line 1, column 5306: Instantiation of [simple type, class com.hubspot.sync.core.messages.SyncMessageRequest] value failed (java.lang.NullPointerException): propertyNameToValues value",
  "correlationId": "09da94c3-5b03-4820-9daa-f9db4346b60c",
  "requestId": "152f3f04a469f78924395a5433e5ed76"
}

Some of the data I was sending shouldn't have been included, which invalidated the entire request. Hence why I was seeing chunks of deals missing.

Thanks again for the quick response!

View solution in original post

2 Replies 2
IsaacTakushi
HubSpot Employee
HubSpot Employee

Ecomm Bridge - Sync Messages API not receiving messages intermittently

SOLVE

Hey, @Walter_Anderson.

I don't know of any limit that would be causing this behavior, but I'm happy to help investigate. First, let's get back to basics. Could you clarify the following?

  1. Are you using OAuth or an API key to authenticate your requests? (From the looks of your apps page, I suspect you're using an API key, but want to be sure.)
  2. Are you only missing deal objects, or contacts and line items too?
  3. Do your batch sync messages only contain one object type (e.g. 200 CONTACT records, then 200 DEAL records), or do the message payloads contain multiple object types and you loop through, swapping out the object type in the request URL? (I have seen both approaches.)
  4. How are you certain that the sync messages were sent? What response code did HubSpot return?
  5. Would you share example sync messages of objects which you sent and received 204s for, but can't be retrieved from this endpoint? Please specify their object types.
  6. What does the Check sync status endpoint return for these "missing" objects?

Isaac Takushi

Associate Certification Manager
0 Upvotes
Walter_Anderson
Solution
Member

Ecomm Bridge - Sync Messages API not receiving messages intermittently

SOLVE

Hey Issac, thanks for the response.

In typical developer fashion, as soon as I submit the post I find some new information that helps diagnose the issue. Your questions definitely helped me get there as well, so thank for you that.

My primary issue was with my reporting logic, which resulted in some of the Hubspot responses being suppressed. So of course once I had an error message to work with, I found the bug in my sync script.

For posterity, the error was a 400 validation error:

{
  "status": "error",
  "message": "Invalid input JSON on line 1, column 5306: Instantiation of [simple type, class com.hubspot.sync.core.messages.SyncMessageRequest] value failed (java.lang.NullPointerException): propertyNameToValues value",
  "correlationId": "09da94c3-5b03-4820-9daa-f9db4346b60c",
  "requestId": "152f3f04a469f78924395a5433e5ed76"
}

Some of the data I was sending shouldn't have been included, which invalidated the entire request. Hence why I was seeing chunks of deals missing.

Thanks again for the quick response!