email_campaign table

I am looking to use the API in order to pull in the “email_campaign” table. This table’s ID contains the email identifier for email events’ email_campaign_id. Is there a way to use the API to populate a local copy of that?

Hi @danr, which part of the app are you in? I can’t quite visualize what you mean by the email_campaign table. From your description, it sounds like you’d want to use this API: https://developers.hubspot.com/docs/methods/email/email_events_overview, but I’m not totally clear on what you’re asking

Thanks Connor

We were replicating the Hubspot tables to Fivetran, and that table was one of the ones that we can see when we use a tool to look at our Fivetran data. I am looking for a way to import that table automatically via API.

Dan

This is how to do it -

Use this API call to get a list of all of the campaign IDs:

https://api.hubapi.com/email/public/v1/campaigns/by-id?hapikey=key&limit=1000

Then, call this one to grab the details from the email_campaign table:

https://api.hubapi.com/email/public/v1/campaigns/{campaign[‘id’]}?hapikey=key