APIs & Integrations

GKing8
Member

Extracting events from API

SOLVE

I need to get all contact events from our HubSpot account.   

 

I'm using the events api (endpoint: /events/v3/events) and I'm able to get form submissions and page views (e_submitted_form and e_visited_page) but no other event type. 

 

When I specify any other event, like e_marketing_event_attendance, I get the following error:

Your app doesn't the have scopes needed to make this call. Do you have access to the 'business-intelligence' scope?  Missing auth details: event-detail-read"
However, if I use the OAuth token-info endpoint, I can clearly see business-intelligence listed.  
 
As far as I can tell, from the UI, this toke has every scope that can be checked, checked.
 
Is there some setting or other endpoint I can use to extract the rest of the event data?
0 Upvotes
1 Accepted solution
Jaycee_Lewis
Solution
Community Manager
Community Manager

Extracting events from API

SOLVE

Hey, @GKing8 👋 What level of subscription does your portal have? The documentation calls out that you need to have an Enterprise subscription to use this endpoint — “Use the event analytics API to fetch events associated with CRM records of any type (Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise only).”  

 

If your portal does not have an Enterprise subscription:

— is this a paid portal?

— or, are you using an app test account created from your dev account?

— can you share an example of a successful call and one that fails, please?

 

Thanks! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

View solution in original post

0 Upvotes
2 Replies 2
Jaycee_Lewis
Solution
Community Manager
Community Manager

Extracting events from API

SOLVE

Hey, @GKing8 👋 What level of subscription does your portal have? The documentation calls out that you need to have an Enterprise subscription to use this endpoint — “Use the event analytics API to fetch events associated with CRM records of any type (Marketing Hub Enterprise, Sales Hub Enterprise, Service Hub Enterprise, or CMS Hub Enterprise only).”  

 

If your portal does not have an Enterprise subscription:

— is this a paid portal?

— or, are you using an app test account created from your dev account?

— can you share an example of a successful call and one that fails, please?

 

Thanks! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
GKing8
Member

Extracting events from API

SOLVE

Hi Jaycee,

 

It looks like the subscription might be the issue.  We have Marketing Hub Professional and Sales Hub Professional with a 45k additional contacts.   I was just confused because the endpoint works for those two items, but nothing else.

 

Here is a successful call and response with the data scrubbed:

curl --location 'https://api.hubapi.com/events/v3/events/?objectType=contact&eventType=e_submitted_form&objectProperty.email=SCRUBBED' \
--header 'Authorization: SCRUBBED'

 

{
    "results": [
        {
            "objectType": "CONTACT",
            "objectId": "SCRUBBED",
            "eventType": "e_submitted_form",
            "occurredAt": "2024-06-10T16:12:50.866Z",
            "id": "leviathan-2032596a-4876-46d5-8b86-9d18e8fa8928",
            "properties": {
                "hs_url": "SCRUBBED",
                "hs_title": "SCRUBBED",
                "hs_referrer": "https://www.google.com/",
                "hs_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
                "hs_city": "los angeles",
                "hs_region": "ca",
                "hs_country": "us",
                "hs_form_id": "e80a792e-d8f7-4841-b25b-32b47520f833",
                "hs_form_correlation_id": "abc8fa8e-9866-4b2b-a8b2-935a796ce6d2"
            }
        }
    ]
}

 

And here is a failed call:

curl --location 'https://api.hubapi.com/events/v3/events/?objectType=contact&objectProperty.email=SCRUBBED&eventType=e_document_completed' \
--header 'Authorization: SCRUBBED'
{
    "status": "error",
    "message": "Insufficient scopes, requires one of: [event-detail-read]",
    "correlationId": "fd831e71-32dd-4c43-986c-fd2faed3c2e5",
    "errors": [
        {
            "message": "Your app doesn't the have scopes needed to make this call. Do you have access to the 'business-intelligence' scope?  Missing auth details: event-detail-read"
        }
    ],
    "category": "INVALID_AUTHENTICATION"
}

 

0 Upvotes