APIs & Integrations

dbhoward
Participant

Klipfolio - custom API call for e-mail send statistics

Résolue

We use Klipfolio for dashboarding.

 

It looks like I need to build a custom API call to HubSpot get the data I want - sent, bounce, etc.

 

This link, seems to point to the right endpoint, etc. :

https://developers.hubspot.com/docs/methods/email/get_event_by_id

 

However, how am I supposed to determine the eventID of the email, and the create time in epoch seconds? How can I know or determine that from the HubSpot GUI interface review of the e-mail stats?

 

I'm not finding any clues in the dox.

0 Votes
1 Solution acceptée
dbhoward
Solution
Participant

Klipfolio - custom API call for e-mail send statistics

Résolue

Finally got it - have to use the campaign endpoint for the summary data, not email events, which provides detail:

 

https://api.hubapi.com/email/public/v1/campaigns/[hubspot internal id from 'see details' in email front end]/?hapikey=[my secret api key]

 

 

Note also, that for an A/B test email, as is the one in question for me right now, it returns details by A variant, B variant, and the 'winner' variant - all 3 distinct pieces of data.

 

But no overall gross summary of the email. i.e. all sends, all dropped, all bounces, etc.

 

If I expect details for the same campaign to excel, I am able to calculate an overall summary in Excel. (And upload that to Klipfolio)

Voir la solution dans l'envoi d'origine

10 Réponses
IsaacTakushi
HubSpot Employee
HubSpot Employee

Klipfolio - custom API call for e-mail send statistics

Résolue

Hi, @dbhoward.

 

If you're looking to retrieve send, delivery, bounce, open, and click information for an email (campaign) or recipient, then I'd actually recommend this endpoint.

 

While campaignId values can be found in the UI in an email's See details section under Internal HubSpot ID, you won't be able to find create dates and other epoch millisecond timestamps on the front end. Most of the endpoints assume your app is using other endpoints like Get all campaigns and  Get campaign data to retrieve the requisite data.

Isaac Takushi

Associate Certification Manager
0 Votes
dbhoward
Participant

Klipfolio - custom API call for e-mail send statistics

Résolue

So which value is going to be the campaign URL in this UI URL?

 

https://app.hubspot.com/email/2xxxxxx/details/7yyyyyyyyy/performance

 

 

the 'y' value?

0 Votes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Klipfolio - custom API call for e-mail send statistics

Résolue

Hey, @dbhoward.

 

Neither. Per my last message, the campaignId is located under See detailsInternal HubSpot ID.

Isaac Takushi

Associate Certification Manager
0 Votes
dbhoward
Participant

Klipfolio - custom API call for e-mail send statistics

Résolue

Ok, I got it. didn't follow you. found the campaign id in the 'see details' section of the email stats review page in the UI

0 Votes
dbhoward
Participant

Klipfolio - custom API call for e-mail send statistics

Résolue

Klipfolio errors, even when using the correct value for campaign ID, but in a browser, the URL returns:

 

{"hasMore":true,"offset":"xxx","events":[{"appName":"AbBatch","ipAddress":"217.86.118.48","browser":{"name":"Thunderbird 60.6.1","family":"Thunderbird","producer":"Mozilla Foundation","producerUrl":"https://www.mozilla.org/","type":"Email client","url":"https://www.mozilla.org/en-US/thunderbird/","version":["60.6.1"]},"duration":3286,"userAgent":"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Lightning/6.2.6.1","created":1553793102833,"location":{"country":"GERMANY","state":"bayern","city":"neumarkt in der oberpfalz","latitude":49.2803},"id":"325e1fca-7c19-3c0e-a6e4-b48d7c7393cd","recipient":"admin@pettering.de","sentBy":{"id":"8091e8fc-47a1-4edd-b72a-ebdc2b984e28","created":1553514509688},"smtpId":null,"portalId":2818205,"type":"OPEN","filteredEvent":false,"deviceType":"COMPUTER","appId":20185,"emailCampaignId":71056404,"emailCampaignGroupId":71056402}]}


Which doesn't look like summary data, but detail data. 

0 Votes
dbhoward
Solution
Participant

Klipfolio - custom API call for e-mail send statistics

Résolue

Finally got it - have to use the campaign endpoint for the summary data, not email events, which provides detail:

 

https://api.hubapi.com/email/public/v1/campaigns/[hubspot internal id from 'see details' in email front end]/?hapikey=[my secret api key]

 

 

Note also, that for an A/B test email, as is the one in question for me right now, it returns details by A variant, B variant, and the 'winner' variant - all 3 distinct pieces of data.

 

But no overall gross summary of the email. i.e. all sends, all dropped, all bounces, etc.

 

If I expect details for the same campaign to excel, I am able to calculate an overall summary in Excel. (And upload that to Klipfolio)

IsaacTakushi
HubSpot Employee
HubSpot Employee

Klipfolio - custom API call for e-mail send statistics

Résolue

Hey, @dbhoward.

 

You're absolutely correct. HubSpot considers each distinct send event a "campaign," so an A/B test will comprise three campaigns.

Isaac Takushi

Associate Certification Manager
0 Votes
dbhoward
Participant

Klipfolio - custom API call for e-mail send statistics

Résolue

It would be nice if it reported under a single campaign ID an aggregate number.

 

The front-end appears to report some aggregate number - would be useful to pull the same data via the API.

0 Votes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Klipfolio - custom API call for e-mail send statistics

Résolue

Thanks, @dbhoward. I'll pass your feedback along.

Isaac Takushi

Associate Certification Manager
0 Votes
IsaacTakushi
HubSpot Employee
HubSpot Employee

Klipfolio - custom API call for e-mail send statistics

Résolue

Hey, @dbhoward.

 

We just released a CMS Marketing Email API which has a Get the statistics for a marketing email endpoint. From my understanding, this should include data from all relevant campaigns, so this may be what you're looking for!

Isaac Takushi

Associate Certification Manager
0 Votes