Is there a way to list all the Timeline events for a given user or portal or event type, etc.?
There is documenation here Accounts Dashboard | HubSpot for getting a specific event, but there are issues with this:
1. It requires an event ID and an event type ID. Why both (unless the type ID is a filter)?
2. It states that an access token is necessary in the URL, yet such a parameter isn’t listed in the formatted URL at the top. (I think this is an error in the documentation, as this parameter and the description of the event-type-id parameter look to be copied from the documentation for creating events. If it IS required, what is the format in the URL?
Anyway, can I list all events?
Hi @Renegade,
I’ve got some reples for you below:
When you’re creating a timeline event: Accounts Dashboard | HubSpot, Accounts Dashboard | HubSpot, take a look at the ID parameter. You’ll pass this in through the request body like:
{
"id":"3",
"email":"test@test.com",
"eventTypeId":"123"
}
This is an ID that you pass in when creating the event. Event types have separate IDs. So for example if you have event types with IDs of 387329 and 387331, they can each have “events” with the same numerical IDs. But they’ll be separate events because the event types are different. And so to continue that example, let’s assume that each of those event types have an event with an ID of 1. You could then get the details about those events like so:
- /integrations/v1/:application-id/timeline/event/387329/1
- /integrations/v1/:application-id/timeline/event/387331/1
I’ll need to double check on this, but I think you’re right that the documentation could use an udpate. You can use an oauth access token to authenticate the request. As for getting the events, the idea is that the ID for the event is stored in your external system, and so there isn’t a method for bulk getting timeline events.
Let me know if you have any quesitons about these.
- Leland
Hmm. A little odd that events don’t have (completely) unique IDs, but at least you’ve explained that bit to me. Thanks.
Regardless, all event instances certainly CAN be enumerated, and I can’t think of a good reason not to have this method. At the bare minimum, there ought to be a function to get all the events for a given event type.
Thank you again.