APIs & Integrations

S1
Participant

The StartTimestamp and endTimestamp Filters in Email Events API doesn't filter the data correctly

We are trying to use the startTimestamp and endTimestamp filters in the Email Events API to filter out the result set as needed. In our case, we are trying to fetch data from  Jan 01 2019 to Jan 31, 2019. Unfortunately, we get back Email Events for all of January and other months (such as May, April, Etc..). 

Some assistance to help fix this issue would be greatly appreciated.
This is how we are using the filters in the API string.  
https://api.hubapi.com/email/public/v1/events?startTimestamp=1546300800000&endTimestamp=154897920000...

 

0 Upvotes
3 Replies 3
IsaacTakushi
HubSpot Employee
HubSpot Employee

The StartTimestamp and endTimestamp Filters in Email Events API doesn't filter the data correctly

Hi again, @S1.

 

I searched through 2,000 email events over two pages and did not find any events that had created timestamp values (per our discussion here) outside of your defined range.

 

Are you referring to events like this:

 

{
      "appName": "Batch",
      "recipient": "[redacted]",
      "dropMessage": "[redacted] has unsubscribed from the portal",
      "dropReason": "PREVIOUSLY_UNSUBSCRIBED_PORTAL",
      "portalId": 1638705,
      "emailCampaignId": 69476190,
      "created": 1548951313505,
      "appId": 113,
      "id": "55d1f46f-495b-4ffd-8a98-a966aaf4459b",
      "from": "[redacted]",
      "replyTo": [
        "[redacted]"
      ],
      "cc": [],
      "bcc": [],
      "subject": "Webinar Recording: [redacted]",
      "causedBy": {
        "id": "cdc1a85d-3012-3400-8377-7d11af8ec9b5",
        "created": 1528305634086
      },
      "sentBy": {
        "id": "55d1f46f-495b-4ffd-8a98-a966aaf4459b",
        "created": 1548951313505
      },
      "smtpId": null,
      "type": "DROPPED"
    }

wherein the event's created timestamp of 1548951313505 falls within your range at 31 January 2019 at 11:15:13 UTC-5:00, but thecausedBy object's created timestamp of 1528305634086 does not, at 6 June 2018, 13:20:34 UTC-4:00.

 

Below is a redacted screenshot of the email event above on this contact record:

 

Event 55d1f46f-495b-4ffd-8a98-a966aaf4459b.jpg

If this is not the behavior you're referring to, could you specify a few email event ID values (like 55d1f46f-495b-4ffd-8a98-a966aaf4459b) which you believe should be excluded from the endpoint's results?

Isaac Takushi

Associate Certification Manager
0 Upvotes
S1
Participant

The StartTimestamp and endTimestamp Filters in Email Events API doesn't filter the data correctly

Hello Takushi,
Thanks for reverting back. My question in regards to this post though is not about which "Created " timestamp to use rather how to make the paging stop after fetching all the records for the month of January alone.  Unfortunately, I am able to retrieve records beyond the said timestamp limits. 

 

Thanks

0 Upvotes
IsaacTakushi
HubSpot Employee
HubSpot Employee

The StartTimestamp and endTimestamp Filters in Email Events API doesn't filter the data correctly

Hi, @S1.

 

Do you have logic that stops your app from calling when this endpoint returns "hasMore": false?

Isaac Takushi

Associate Certification Manager
0 Upvotes