APIs & Integrations

TimMunro
Contributor | Platinum Partner
Contributor | Platinum Partner

Marketing Events API Search Returns No Results

Looking to use the "Search for marketing events" endpint as described  here:

https://developers.hubspot.com/docs/api/marketing/marketing-events

 

It describes a GET URL thus:

GET /marketing/v3/marketing-events/events/search?q=my-event-id

 

This call never seems to return any results - i.e. always get back:

 

{
  "results": []
}

 

 

In my test account I created an event with external id of "7" and can use the "get event" endpoint to verify it was created OK thus:

GET /marketing/v3/marketing-events/events/7?externalAccountId=12121

Returns the respons:

 

{
  "id": "7",
  "noShows": 0,
  "eventUrl": null,
  "attendees": 0,
  "createdAt": "2021-11-02T00:42:07.809Z",
  "eventName": "7",
  "eventType": "eventType",
  "updatedAt": "2021-11-02T00:42:07.809Z",
  "endDateTime": null,
  "registrants": 0,
  "cancellations": 0,
  "startDateTime": "2021-11-02T00:42:07.658Z",
  "eventCancelled": false,
  "eventOrganizer": "Test Event4 Organizers",
  "externalEventId": "7",
  "customProperties": [
    {
      "name": "hs_event_status",
      "value": "ONGOING",
      "sourceVid": []
    }
  ],
  "eventDescription": null
}

 

 

However the call:

GET /marketing/v3/marketing-events/events/search?q=7

 

continues to to return no results. Is there an issue with this endpoint, or am I using it incorrectly?

 

Thanks!

6 Replies 6
Jasper_Madrone
Participant

Marketing Events API Search Returns No Results

I created an app to help with this if you are interested. It is approved on the HubSpot marketplace, and I think it could help your use case. It allows you have a settings page UI to create events directly in the HubSpot tool without needing to go to the API. I also added a Workflow action that can manage the registration status of contacts for the created events.

Check it out here

 

Note that for your question, you must be using an OAuth connection to search for the event, and you can only search for events created by said OAuth connection.

 

AlexBril
Contributor | Platinum Partner
Contributor | Platinum Partner

Marketing Events API Search Returns No Results

Thanks Jasper

---

Best regards,

Alex Bril
HubSpot Consultant
at Cuex

Don't bother to contact me via alex@cuex.tech
0 Upvotes
AlexBril
Contributor | Platinum Partner
Contributor | Platinum Partner

Marketing Events API Search Returns No Results

Hi @TimMunro

I'm having the same problem in getting the information out of a Marketing event for further use.

In addition I can't retrieve an ID (like your '7') in any way or set an ID when creating a new Marketing event. Maybe HubSpot has changed this in the meanwhile.

I've also tried to create a custom Marketing event property called 'id', but then it says it is not possible since it already exists (which I already thought would happen). I know my Marketing events have ID's, but I'm just not able to retrieve those. 

I'm curious on how you got to your solution. 

Best regards,

Alex Bril 
HubSpot Consultant at Cuex

---

Best regards,

Alex Bril
HubSpot Consultant
at Cuex

Don't bother to contact me via alex@cuex.tech
0 Upvotes
TimMunro
Contributor | Platinum Partner
Contributor | Platinum Partner

Marketing Events API Search Returns No Results

Hey @AlexBril - I did not manage to get this to work, I suspect there is a bug in the HubSpot API. I continue to watch this thread with the hope that, at some point, the HubSpot team will resolve and let us know.

0 Upvotes
taganay
Contributor

Marketing Events API Search Returns No Results

Hi @TimMunro. Not sure if this is actual anymore. I was able to get the results using the "*" as a query: 

curl --location 'https://api.hubapi.com/marketing/v3/marketing-events/events/search?q=*' \
--header 'Authorization: Bearer <accessToken>'

It returned both objects I created, but without any fields:

{
    "results": [
        {
            "appId"53904,
            "externalAccountId""2023-10-18T16:10:06.827Z",
            "externalEventId""string"
        },
        {
            "appId"53904,
            "externalAccountId""string",
            "externalEventId""string"
        }
    ]
}





0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Marketing Events API Search Returns No Results

@Teun ,

Any chance you have messed around with this?

0 Upvotes