Hello,
We have an application that generates a report of stats for emails sent by a workflow. The report gets all the opens/clicks/etc. and groups all the stats by recipient.
Our current process goes like this:
1. Get all data about a specific workflow using the following endpoint:
https://developers.hubspot.com/docs/methods/workflows/v3/get_workflow
2. Loop over the ‘actions’ array and store all the emailCampaignId values in a temporary variable
3. Then we call the following endpoint for each emailCampaignId we store from the previous step. We only use the emailCampaignId in each call.
https://developers.hubspot.com/docs/methods/email/get_events
4. Finally we process the response to generate the data we need
This procedure has been working fine for us whenever we wanted a report for a workflow that sent emails in the past. However, we just came across an issue where the email events api was returning the following error: “query params ‘appId’ and ‘emailCampaignId’ must be specified together”. It seems like this error occurs whenever we query using an emailCampaignId for an email that hasn’t been sent yet.
I’m trying to understand why this error doesn’t occur when a campaign has already been sent by a workflow. Other resources I found also say that the emailCampaignId and appId should be sent together (for example: https://developers.hubspot.com/docs/methods/email/email_events_overview), but why didn’t the endpoint return an error before?
My other issue (and main question) is that I don’t know where to get the appId that the error is complaining about. I found this resource:
But this seems to be about apps created in the developer account. I found other posts in this forum but they are also talking about apps in the developer account. The emails are sent by a workflow so they are not associated with an app.
I did notice that all the events in the email events api are returning an appId of 2286 but I can’t find that documented anywhere.
Where can I get this appId?
Thank you.