Analytics API - Listing Pages and Knowledge Articles


#1

I am building a tool for users to view their HubSpot Analytics data and allowing them to split the data based on each endpoint's main object.

For example, in regards to the Hosted Content endpoint (analytics/v2/reports/:content_type/:time_period), I am allowing the users to split the data by the content type object. So if the user chooses landing-pages or standard-pages, I take the Page ID returned by the breakdown field and get the name of that page using the List Pages endpoint (content/api/v2/pages).

This way the user can see the data split by a readable name and not by an ID. However, when using the listing-pages or knowledge-articles content types, I am not able to find an endpoint where I can swap those IDs for more human readable names or titles. Is there an endpoint that returns some metadata or something for each of these?


#3

Hi again, @Wes_Thompson,

That's a good question. What do you get when you query the Get a page by ID endpoint? Could you share the IDs of a few listing-pages and knowledge-articles you're testing with?

I don't know of any other endpoints that may return metadata on those page types, but I can certainly check with the team with some specific examples.


#4

Hi @Isaac_Takushi,

I am using hapikey=demo to test all of these endpoints. The full request looks like this: https://api.hubspot.com/analytics/v2/reports/listing-pages/total?hapikey=demo. The first two ID's I get back are 6206877519 and 304641. When I send those IDs into the List Pages endpiont I get no results. When I use either of them for the Get a Page by ID endpoint I get a response message that says "resource not found".

When I make a similar request using knowledge-articles instead of listing-pages I actually get no results back. Do you guys not have any demo data for knowledge articles? This is actually the same with social-assists on the Get Analytics Data for Specific Objects endpoint. It's returning no data for hapikey=demo.


#5

Hey, @Wes_Thompson.

Ah, that makes sense. The demo account (Hub ID 62515) actually doesn't even have the knowledge base tool in it.

The team has been moving toward encouraging developers to use test accounts through developer accounts rather than the demo portal (accessed through hapikey=demo.

If you set up a test account (or already have one) and share the Hub ID with me, I can add a trial Service Hub subscription for testing.


#6

Okay, @Isaac_Takushi.

I've created a test account (Hub ID 5113330). If I use this to test, will it return test data similar to the demo account or do I have to create my own test data?


#7

Hey, @Wes_Thompson.

Alright, I've added a Service Hub Enterprise trial to test account 5113330. You should now be able to create knowledge base articles.

You will have to create or import your own test data. Sorry for the inconvenience there.


#8

Hey, again, @Wes_Thompson.

I've run some tests in my own portal have confirmed that there currently is no way to retrieve readable names for blog listing pages or knowledge base articles.

While I don't expect this to change for blog listing pages since they're not distinct pages with different titles, I will admit that current API support for the knowledge base tool is lacking.

I'll ask the knowledge base team to see if there are plans to release public endpoints for the tool. In the meantime, I recommend upvoting and commenting on this existing feature request. I've just upvoted it as well.


#9

Currently, there are no plans to release public endpoints for knowledge base articles, but if the team sees engagement on this feature request, they may consider implementing solutions in the future.


#10

Hi @Isaac_Takushi,

Thank you for the information. I have upvoted the feature request you mentioned and look forward to any improvements on this.