I use the email event api to get data about the number of mail sent to customers for a selected time period
But the result returned is different from what is displayed on Hubspot UI
How to use the data when using API matches the display on the email analysis
developers.hubspot.com
GET /email/public/v1/events
The difference is quite high
I need to get the correct data to make the report
Please help me answer this issue, if you know how it works
Thanks very much!
[
hubspot.png1184×375 39.9 KB
](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/c/c32b94c6acf7e6765d9773636bfe96b0d78249a2.png)
The document may match the image above get by Email Events API
Welcome, @Vi_Quyet.
Happy to help.
Could you share the following?
- Your Hub ID.
- A link to the email campaign you’re seeing discrepancies with? (I want to compare the up-to-date API and UI data.)
Thanks Takushi,
i used url : url = "https://api.hubapi.com/email/public/v1/events?" + str(offset) + “hapikey=my_key_api&eventType=SENT&startTimestamp=1543597200000&endTimestamp=1546189200000&limit=1000”
and get result = 4189 with time start = 12/01/2018 and time end = 31/12/2018
Differential results 4189 - 4155 = 34
Can you help me explain that difference ? Thanks so much!
Hi, @Vi_Quyet.
Apologies for the delayed response. Thank you for sharing that information.
It seems you are using slightly different startTimestamp and endTimestampvalues than the email Analyze tool you referenced. If you go to this page, it shows the same statistics you reference in your screenshot, including 4,155 sends.
The URL shows this report is generated with the startDate=1543590000000, which is 2 hours earlier than your startTimestamp=1543597200000 and the endDate=1546268399999, which is almost a full day later than your endTimestamp=1546189200000, which only goes until 30 December instead of 31 December.
Since your timeframe is shorter, it contains fewer sends.
If you use the parameters:
startTimestamp=1543590000000
endTimestamp=1546268399999
Then I would expect the number of sends to match.