APIs & Integrations

Camden
Member

CTA buttons won't pull through API

We are developing a new site and pulling content from the API. Unfortunately sometimes CTA buttons appear; sometimes they do not. The CTA buttons are created in the same way in Hubspot and we cannot figure out why some do not appear.

Here is an example, where the button did not get pulled:

http://blog.thecamdengroup.com/blog/facing-bundled-payments-2 (current blog through hubspot, “Click to Read” button is there)

http://projects.spinxweb.net/ge/insight-detail/facing-bundled-payments-00 (appearing on new site, no button)

I’ve tried the front line support and they have not been able to determine what the issue is. I can also send links that show an example where the button WAS pulled but as a new user I seem to be restricted to only two links per post. Please help - thanks!

0 Upvotes
14 Replies 14
Keyur_Ajmera
Member

CTA buttons won't pull through API

Hi @pmanca,

We are use below API for get blog post.

  1. (Where we are not getting widget body.)
    https :// api.hubapi.com/content/api/v2/blog-posts?hapikey=[API KEY]&limit=10&name=Facing%20Bundled%20Payments
    Screenshot: https :// www.screencast.com/t/u59BmLgdz

  2. (Where we are getting widget Body)
    https :// api.hubapi.com/content/api/v2/blog-posts?hapikey=[API Key]&limit=10&name=New%20White%20Paper%20Download:%20Top%2010%20Characteristics%20of%20High-Performing%20Healthcare%20Organizations
    Screenshot: https :// www.screencast.com/t/6jRyWXzB0

Let us know if it will help.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

CTA buttons won't pull through API

@Keyur.Ajmera When you pull the blog post from the API the CTAs come over wrapped in HubL which is our proprietary templating language. The browser won’t be able to render the HubL and that is why your CTAs won’t display.

0 Upvotes
sjakharia
Member

CTA buttons won't pull through API

@pmanca If the browser wont display the CTA because it’s wrapped in HubL, How do we go about displaying the CTA on the browser? Can you point us in a direction so this can be resolved?

Thank you in advance for your help.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

CTA buttons won't pull through API

@sjakharia you need to grab the javascript embed code for the CTA and then you can use that to display it on the page.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

CTA buttons won't pull through API

Do you get any errors in the console when they don’t display? Have you tried setting break points in your site and debugging out to see if their is a conflict for why it might not be loading?

Is this on HubSpot hosted pages?

0 Upvotes
Camden
Member

CTA buttons won't pull through API

We are not getting errors on the console. The response code is blank. But at times, some other posts that are pulling in from HubSpot, have the response codes to pull in the widget.

These posts are not hosted on HubSpot. We are pulling data from HubSpot to our own site.

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

CTA buttons won't pull through API

@Camden Does this page have the HubSpot tracking code on it?

0 Upvotes
Camden
Member

CTA buttons won't pull through API

Hi yes, that page has the hubspot tracking code on it. The issue with those CTA’s is that Hubspot does not provide those CTA on their feed.

Hubspot tracking code embedded on our site

Does this help?

0 Upvotes
Camden
Member

CTA buttons won't pull through API

Sorry, I am trying to send you a screenshot of some code my developer sent to me - for some reason it does not appear in the post. Is there way to post an image so you can see it?

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

CTA buttons won't pull through API

@Camden You should be able to upload a file by hitting the arrow pointing up in the editor.

if it is saved to your clipboard you should be able to paste it in to the screen as well. An example of your code might help. This is tough if you don’t have any errors being generated on your site.

0 Upvotes
Camden
Member

CTA buttons won't pull through API

hi here is the screenshot of the email my developer sent me. Is there any way i can connect you with him so that yoyu two may be able to speak directly? we need to launch our new site and need to resolve this issue asap. Thanks!

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

CTA buttons won't pull through API

@Camden Your developer can always hop here and join in the conversation. I don’t see any issues so we would have to dive into your website code and see why the CTA embed code fails that network call to HubSpot or the display of it.

0 Upvotes
Camden
Member

CTA buttons won't pull through API

Okay what is the best way for you to see the website code and be able to investigate it further?

0 Upvotes
3PETE
HubSpot Employee
HubSpot Employee

CTA buttons won't pull through API

@Camden You should rope in your developer to help go through it as the error is on his side. Also looking at the code of the page you posted with out the CTA, I don’t even see the embed code for the CTA on it. Maybe I am missing something

0 Upvotes