APIs & Integrations

knaps
Member

Best way to list pages using only JS?

SOLVE

Hello!

 

I'm a bit of a newbie at Hubspot, but we're hosting a separate website with light integration with HubSpot. Right now it only embeds unstyled forms into some of our pages.

 

A colleague has asked that we integrate to show collections of our blog posts and landing pages, and I'm wondering the best way to go about that from a static HTML/JS website. I've been reading about sunsetting the hapikey and understand that that will be going away soon.

 

Given that our site is not Node/Ruby/PHP/Python, what's the recommended way to query and retrieve a list of landing pages? A list of blog posts? How might we query a single blog post to populate our pages?  I understand that OAuth requires some kind of backend processing, but our site is simply static html right now.

 

Again, this is all very new to me, so sorry if there's an obvious answer. I didn't find a lot of examples out there, and it seems like the sunsetting will invalidate what I found useful in the docs.

0 Upvotes
1 Accepted solution
Anton
Solution
Recognized Expert

Best way to list pages using only JS?

SOLVE

Hi @knaps

 

let's start with the "easier" one.

 

You can get an RSS feed from your blog posts - this can be turned into a listing on an external page. There are many options you have.

  • My personal recommendation would be the widget from elfsight. Have used other elfsight widgets in the past and they have worked flawlessly. 
  • If you like to do it manually you can try bloople.net. This can be used to transform a single (or many) posts to HTML so you can easily copy/paste them to your page.
  • You could look for a zapier integration.
  • Build yourself a webhook solution. (Kinda like elfsight does) But this would be an overengineered solution for single blogposts.

But the most important: here's the documentation from HubSpot how to get the RSS Feed.

 

If you like to display only one (specific) post you can download the RSS, remove all unneeded posts, upload the new rss file to your webspace and use this RSS file for your embed solution (elfsight or bloople)

 

As for the pages

Like @Jaycee_Lewis mentioned the best way would be Private Apps if you'd like to have them automated. But the question would be - what do you want to achieve/do with the list of pages? Just asking because if you just want to "embed" the pages in your HTML page I highly advise against doing so. An much easier approach would be to just link to the HubSpot page from your HTML page. 

 

 

best, 

Anton

Anton Bujanowski Signature

View solution in original post

4 Replies 4
Jaycee_Lewis
Community Manager
Community Manager

Best way to list pages using only JS?

SOLVE

Hey, @knaps 👋 Welcome to the community! We'll split this up a bit to help keep us organized.

 

For the API key sunset:

  • As long as you are not building an app to offer via the Marketplace to be used by multiple portals (which it sounds like you are not) you can use Private Apps with our endpoints. 
  • To help understand where you can use your private app key, look for the OAuth flag on any of the endpoint listings
    use_token.png

 

For thoughts on building this out, and what you could build yourself versus needing help with, let see if the community has any feedback. Hey @Anton @Mark_Ryba @Sjardo do you have any thoughts on how @knaps can approach this project?

 

Thank you! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
Anton
Solution
Recognized Expert

Best way to list pages using only JS?

SOLVE

Hi @knaps

 

let's start with the "easier" one.

 

You can get an RSS feed from your blog posts - this can be turned into a listing on an external page. There are many options you have.

  • My personal recommendation would be the widget from elfsight. Have used other elfsight widgets in the past and they have worked flawlessly. 
  • If you like to do it manually you can try bloople.net. This can be used to transform a single (or many) posts to HTML so you can easily copy/paste them to your page.
  • You could look for a zapier integration.
  • Build yourself a webhook solution. (Kinda like elfsight does) But this would be an overengineered solution for single blogposts.

But the most important: here's the documentation from HubSpot how to get the RSS Feed.

 

If you like to display only one (specific) post you can download the RSS, remove all unneeded posts, upload the new rss file to your webspace and use this RSS file for your embed solution (elfsight or bloople)

 

As for the pages

Like @Jaycee_Lewis mentioned the best way would be Private Apps if you'd like to have them automated. But the question would be - what do you want to achieve/do with the list of pages? Just asking because if you just want to "embed" the pages in your HTML page I highly advise against doing so. An much easier approach would be to just link to the HubSpot page from your HTML page. 

 

 

best, 

Anton

Anton Bujanowski Signature
Jaycee_Lewis
Community Manager
Community Manager

Best way to list pages using only JS?

SOLVE

Thanks, @Anton 🙌

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
knaps
Member

Best way to list pages using only JS?

SOLVE

Thanks for the primer, Jaycee! I read the article you linked. Creating the keys/permissions seems straightforward enough! Now just figuring out how to do it using only JS.