Developer Announcements

Dadams
HubSpot Employee
HubSpot Employee

Upcoming: Changes to the Marketing Events API

We're releasing some new features for marketing events. These new features include the ability to create contacts from the events, as well as tracking registration and detailed attendance for the events.

 

As part of these updates, we're making changes to the Marketing Events API to support these new features.

 

What's new?

3 new endpoints are being released:

  • POST  /marketing/v3/marketing-events/attendance/{externalEventId}/{subscriberState}/create
    Changes the state of a specified attendee. The state can be: register, attend or cancel. If the state is attend, you can optionally include joinedAt and leftAt values to record how long they attended the event.
  • POST  /marketing/v3/marketing-events/attendance/{externalEventId}/{subscriberState}/email-create
    Works like the previous endpoint, but can use an email address instead of a contact record ID to create a new contact in HubSpot.
  • POST /marketing/v3/marketing-events/events/{externalEventId}/complete
    This endpoint is used after the event is finished, and all attendance updates have been made. Calling this endpoint triggers the calculation of the attendance duration for all attendees, which updates the timeline entries for the attendees.

 

What's being removed?

With the release of the new endpoints, 2 endpoints are being sunset:

  • POST /marketing/v3/marketing-events/events/{externalEventId}/{subscriberState}/upsert
    This is replaced by the new /create endpoint
  • POST /marketing/v3/marketing-events/events/{externalEventId}/{subscriberState}/email-upsert
    This is being replaced by the new /email-create endpoint

 

What's changing?

Aside from the new URLs, the main difference between the old endpoints and the new ones is the support of the optional joinedAt and leftAt fields. Otherwise the data will be the same as you used with the old endpoints.

 

Additionally, you will need to make a request to the new /complete endpoint to make sure that the attendance duration is displayed in the timeline of the related contact records in HubSpot.

 

When is this happening?

The new endpoints and functionality are available today, and can be used immediately. Please see the Marketing Events API documentation for details on using the new endpoints.

 

The 2 sunset endpoints will be removed on April 30th, 2023.

 

Please let us know if you have any questions by replying below.

2 Réponses
RBunney
Membre

Upcoming: Changes to the Marketing Events API

I'm currently trying to use the /marketing/v3/marketing-events/attendance/{externalEventId}/{subscriberState}/email-create endpoint and getting the following response:

    "status": "error",
    "message": "externalAccountId is required",

I can see it's not marked as a required parameter in the documentation. I've since added the parameter to my request body like so:

{
    "inputs": [{
        "interactionDateTime": "2023-03-16T10:00:00.000Z",
        "email": "test@test.com"
    }],
    "externalAccountId": "27093333"
}

But I'm still getting the same error response. Any ideas?

0 Votes
MSafont
Membre

Upcoming: Changes to the Marketing Events API

Hi,

 

Solution is to add externalAccountId as param on the url

 

/create-email?externalAccountId=XX

 

0 Votes