Empty json object returned


#1

Hello Y'all,
I'm new to HubSpot but I have a paid HubSpot account and I'm trying to get the schema of the underlying database on HubSpot.
I found this documentation, which outlines how to access the schema information:

However, when I follow the documentation and use my API key instead of the demo key, I get a blank json object in response:
{'limit': 0,
'message': None,
'objects': [],
'offset': 0,
'total': 0,
'totalCount': 0}

What am I missing? I do have a lot of contacts, companies etc in my account. Why can't I see any tables via the API request?
Any help is much appreciated.
G


#2

Hi @gaurav1, the Get all tables endpoint you've linked is only for HubDB, which is a database format that you can use with the CMS. It isn't related to HubSpot CRM. We don't have an endpoint that gets the underlying schema of every CRM object. To use a Schema that might be useful for a website, a lot of customers will use something like this: https://www.moreycreative.com/blog/adding-schema-to-hubspot-websites. If I have a few more details about your use case, I might be able to suggest something else, but otherwise an entire schema isn't possible to pull from the HubSpot APIs.


#4

Hi Connor,
I'm glad to hear back. So, what I really want is the table/tables containing the following fields:
contact id, url visited, timestamp of when visited, referrer (utm parameters may be)
Can I get that via any APIs?
Thanks a lot,
G


#5

Hi @gaurav1, we don't have one that would break these metrics down by contact, but you might want to try getting higher level analytics overviews, which you can do with specific objects, Analytics API or with specific hubspot hosted content. You could also try getting contacts and specifying which properties you'd like to retrieve as per this endpoint. Something like this would work to get number of pageviews and average pageviews:

api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=demo&count=2&property=hs_analytics_average_page_views&property=hs_analytics_num_page_views


#6

Hi @Connor_Barley
Thanks for your response. I'm trying to do a more in-depth analysis than what HubSpot's analytics API offers and for that I need the timestamped logs of each contact's visits. Surely such a log exists somewhere in HubSpot because when I integrate Panoply with my HubSpot account and export all data, I do see a table named contacts_form-submissions which has information similar to what I asked for. That table has urls of forms but not necessarily urls of non-form pages. So, the first question is how can I access this table from within HubSpot, preferably using the APIs?
Thanks again,
G


#7

Hi @gaurav1, it's possible that your integration constantly pulls data from the "last page seen" contact property so that it gets a full history of that property (though that would be very expensive with API calls), or they're using the Form Submission Mode on the Get all contacts endpoint, which would return an array of data like this:

"form-submissions": [
   {
       "conversion-id": conversion_id,
       "timestamp": timestamp,
       "form-id": form_id,
       "portal-id": XXXXXX,
       "page-url": "https://blog.post.com/file-url-test-2",
       "content-type": "blog-post",
       "page-title": "Blog Test",
       "page-id": page_id,
       "title": "Subscription Form",
       "form-type": "BLOG_SUBSCRIPTION",
       "meta-data": []
   }

As stated in my last reply, unfortunately we don't have an endpoint that will get all page views by timestamp for every contact record.


How to download a log of events
#8

Hey @Connor_Barley,
I think you are right about Form Submission Mode on the Get all contacts endpoint. That's not what I really want. I think I've figured out what I actually want.

I'm trying to do the following:
I created some events (Reports-->Analytics Tools-->Events). A summary count of these events shows up in HubSpot portal (in Reports-->Analytics Tools-->Events). However, I can't figure out how to download a detailed website log of these events or how to access this log via an API.

I tried the following:

  1. Tried the "export" button on Reports-->Analytics Tools-->Events but that gives just a table of the count of events broken by date.
  2. Followed the instructions here: https://developers.hubspot.com/docs/methods/events/get_events
    But that endpoint yields only a list of the created events (event names, properties of the events etc.) but not a website log of which event happened when triggered by who (event, timestamp, contact id).

In a nut shell, I want to know which event happened when triggered by who (event, timestamp, contact id).
Any help will be much appreciated.
G


#9

Hi @gaurav1, that granular information can't be achieved via API or elsewhere. The Events Log is only for debugging purposes only and shows the most recent event completions for the last 12 hours.

You can't get an ordered list of who completed what event and at what time, but you can segment lists based off of Event completion and see it on contacts' timeline. You can also use the Contacts API and get a total number of event completions per contact by filtering based off of that property. The tool was built mostly for overall numbers and testing. i.e. testing how many clicks a menu item get's based off of what color it is or it's contents.

List seg is possible (http://prntscr.com/l2beb8), but itemized lists of event details are not stored by HubSpot. I do see utility in having this functionality, so you may want to suggest this in our Ideas Forum: https://community.hubspot.com/t5/custom/page/page-id/ideaslandingpage. Happy to upvote it and give it a boost as well