# Get email events API - parameter startTimestamp not being respected

**URL:** <https://community.hubspot.com/t/get-email-events-api-parameter-starttimestamp-not-being-respected/66495>\
**Category:** APIs & Integrations\
**Created:** [October 5, 2022, 8:46am UTC](https://community.hubspot.com/t/get-email-events-api-parameter-starttimestamp-not-being-respected/66495 "2022-10-05T08:46:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BambooBox](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@BambooBox](https://community.hubspot.com/u/BambooBox)\
**Post date:** [October 5, 2022, 8:46am UTC](https://community.hubspot.com/t/get-email-events-api-parameter-starttimestamp-not-being-respected/66495/1 "2022-10-05T08:46:41Z")

</div>

Hi,

I am trying to use the API below to fetch the events for a campaign post a given timestamp - [https://legacydocs.hubspot.com/docs/methods/email/get\_events](https://legacydocs.hubspot.com/docs/methods/email/get_events)

and using the parameters as provided in the documentation so my URL looks like below:

[https://api.hubapi.com/email/public/v1/events?campaignId=\<XX\>&limit=1000&startTimestamp=1664947667](https://community.hubspot.com/)

As per the documentation, I expected the API to return all the events for the specified campaign(XX) post the time in startTimestamp parameter. But the API is returning me events even before the time provided.

Is this the correct behavior or am I missing anything? Is there any API to get the event data for a campaign after a specific date? Please suggest.

Best Regards,

Ashima

---

<div class="post-metadata">

**Author:** ![TitiCuisset](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@TitiCuisset](https://community.hubspot.com/u/TitiCuisset)\
**Post date:** [October 6, 2022, 8:38am UTC](https://community.hubspot.com/t/get-email-events-api-parameter-starttimestamp-not-being-respected/66495/2 "2022-10-06T08:38:50Z")

</div>

Hi @BambooBox

Thank you for reaching out.

I want to tag some of our experts here - @coldrickjack @Bryantworks @JBeatty do you have any thoughts for @BambooBox on this?

Thank you!

Best

Tiphaine

---

<div class="post-metadata">

**Author:** ![coldrickjack](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/coldrickjack/32/6684_2.png) [@coldrickjack](https://community.hubspot.com/u/coldrickjack)\
**Post date:** [October 6, 2022, 9:01am UTC](https://community.hubspot.com/t/get-email-events-api-parameter-starttimestamp-not-being-respected/66495/3 "2022-10-06T09:01:15Z")

</div>

Hey @BambooBox,

I think the issue is to do with the value you are including for the startTimestamp query parameter. HubSpot expects the value to be in milliseconds. The value you are passing (1664947667) translates to Tue Jan 20 1970 06:29:07. So it would make sense that you are getting back all of that data.  
I’m not sure what date range you are trying to work within but if I wanted to get all of the events for a campaign on or after 1st of Jan 2022 I’d do something like this:

`https://api.hubapi.com/email/public/v1/events?campaignId=61935014&startTimestamp=1640995200000&limit=20`

---

<div class="post-metadata">

**Author:** ![JBeatty](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jbeatty/32/52252_2.png) [@JBeatty](https://community.hubspot.com/u/JBeatty)\
**Post date:** [October 6, 2022, 2:58pm UTC](https://community.hubspot.com/t/get-email-events-api-parameter-starttimestamp-not-being-respected/66495/4 "2022-10-06T14:58:36Z")

</div>

@BambooBox,

To build upon this, it looks like the timestamp you entered “1664947667” is in seconds, while HubSpot expects milliseconds for its timestamp so if you want to do Wednesday, October 5, 2022 5:27:47 AM you would do “1664947667000” instead.

Best,

---

<div class="post-metadata">

**Author:** ![BambooBox](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@BambooBox](https://community.hubspot.com/u/BambooBox)\
**Post date:** [October 7, 2022, 4:12am UTC](https://community.hubspot.com/t/get-email-events-api-parameter-starttimestamp-not-being-respected/66495/5 "2022-10-07T04:12:35Z")

</div>

Thanks, this was helpful
