Hi I am trying connect the API to power bi so i am able to return all the email event pertaining to a specific email campaign the problem is that its only returning a 1000 events. I understand this is down to pagination. Ive been using copilot and that suggested using an offset command in the url so it would look this:-
https://api.hubapi.com/email/public/v1/events?limit=100&offset=0&campaignId=1234567
however the offset value isnt being recognised how do i ensure i can page through all the events. The URL works without the offset but will only return a maximum of a 1000 rows at a time
Hey @RedKnight - thanks so much for posting in the Community!
I’d like to tag in some API experts to see if they have ay insight for us! @HFisher7, @ashleyidesign, and @matt_scott - any thoughts on being able to see more than 1000 rows at a time?
Shane, Senior Community Moderator
Hey,
The response from your first query should include
“hasMore”: true,
“offset”: “some_value”
you should be able to use the value returned to then make the next request
I think if your limit is 1000, the next offset should be 1000 (rather than 0 in your example) but it’s best to use the response from the previous request
Try asking the AI directly in the docs (next to the search bar), as it’s been trained on the hubspot documentation (it’s AI so will still get things wrong but hopefully less)
Hi thanks i think ive managed to get further now as the offset is returned in the reponse. However I’ve noticed that the time stamps which have ‘created’ in the column names are stored as an interger not a date or time value which is strange so it could have a value such as ‘1759310954603’. Does anyone know how to convert this back to the orginal date and time value. I tried entering it into excel to see if converts back but it doesnt.If it cant then this data is useless for me as I cant report on event happening on specfic dates.