# Email Event API fails

**URL:** <https://community.hubspot.com/t/email-event-api-fails/24316>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [August 18, 2020, 1:57pm UTC](https://community.hubspot.com/t/email-event-api-fails/24316 "2020-08-18T13:57:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frapsi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/frapsi/32/84489_2.png) [@Frapsi](https://community.hubspot.com/u/Frapsi)\
**Post date:** [August 18, 2020, 1:57pm UTC](https://community.hubspot.com/t/email-event-api-fails/24316/1 "2020-08-18T13:57:10Z")

</div>

Hi,

I want to get all email events for a list of certain campaigns using the Email Event API. I am using KNIME Analytics Platform to perform the requests within a loop which requests for each campaign id in the given list get requests and uses the offset parameter to page through all events.

At some point the get request fails. When I reset the loop and execute it again it fails at a different point, so it doesn’t seem to be a specific event/campaign id that causes the problem.

I already thought about rate limits and therefore increased the waiting time between requests up to 2 seconds. Didn’t work.

Any idea what might be causing this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [August 20, 2020, 7:37am UTC](https://community.hubspot.com/t/email-event-api-fails/24316/2 "2020-08-20T07:37:55Z")

</div>

Hey @Frapsi,

In order for me to further troubleshooting this, could you share the following with me:

1. Portal ID

2. The exact request url

3. The full error message

---

<div class="post-metadata">

**Author:** ![Frapsi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/frapsi/32/84489_2.png) [@Frapsi](https://community.hubspot.com/u/Frapsi)\
**Post date:** [August 20, 2020, 8:35am UTC](https://community.hubspot.com/t/email-event-api-fails/24316/3 "2020-08-20T08:35:40Z")

</div>

Hi Wendy,

thanks for your reply.

I think I found the problem meanwhile. I get always a 502 status from my failed requests and I found some posts about 5xx error messages here in the community, e.g. [https://community.hubspot.com/t5/APIs-Integrations/502-Bad-Gateway-errors/td-p/275949 .](https://community.hubspot.com/t5/APIs-Integrations/502-Bad-Gateway-errors/td-p/275949)

So I built another loop in my workflow to re-try the failed request and until now everything works fine even though this is not best practice…
