APIs & Integrations

jing
Participant

Incorrect Events API

I am using the v3 Events API and I met several problems:

  1. I sent `GET/events/v3/events` request with query `?objectType=contact&objectId=number` to get events data for contacts. However, I need to make an API call for each objectId. And we have around 335950 different contacts in the database, which means I need to make 335950 API calls to get all events data. It will probably take days to finish. Is there any efficient way to get all data I want? Maybe query multiple object ids at the same time?
  2. `events/v3/events` endpoint  sometimes does not return all data (also no pagination), if I don't specify `limit` parameter.
  3. The documentation is incorrect. In the page https://developers.hubspot.com/docs/api/events/web-analytics, it says "occurredAt is the only field supported for sorting.". However, 
    only a single sort field 'occurredTimestamp' is supported.
     
    4. when sort parameter is used, it does not return  
    `e_submitted_form` event type,
0 Upvotes
2 Replies 2
Willson
HubSpot Employee
HubSpot Employee

Incorrect Events API

Hi @jing 

 

Thanks for the write-up here on your usage on the Events v3 API. I've been reviewing the points and have managed to replicate them from my end.

 

  1. I can confirm that this endpoint currently only supports the use of 1 object Id when requesting data - This will indeed lead to a large number of calls being required in order to request the event data for your objects. 
  2. I have been unable to replicate this behaviour from my side. When querying my contacts, I was returned a default of 20 results and provided with an after value in order to fetch the next set of results. 
  3. I also managed to replicate this error, specifically receiving the response:
    {
        "status": "error",
        "message": "Only a single sort field 'occurredTimestamp' is supported",
        "correlationId": "b4c6903c-f3f2-45b3-a4c0-03f2fab51fc2"
    }
    I can also confirm that the requested parameter is not a value returned in the response, therefore unusable in the request to sort by. 

I will go ahead and forward on this internally to get our teams looking into this! Thanks again for this feedback.

Product Manager @ HubSpot
jing
Participant

Incorrect Events API

Thanks for the reply! Look forward to see the fix soon. The second issue only occurred for some of the our data.  Maybe that is why you didn't meet the problem. It did happen to us.

 

We encountered another issue: when sort parameter is used (&sort=-occurredTimestamp),  we can not get `e_submitted_form` event_type data.

 

0 Upvotes