<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to Get all blogs using blog portal id in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/how-to-Get-all-blogs-using-blog-portal-id/m-p/767073#M33252</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me out with how to list all the blogs using the blog portal ID?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sjay_0-1678454104802.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/87096i7359B0D42D9F81EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sjay_0-1678454104802.png" alt="sjay_0-1678454104802.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;We can use contents, but I was using another template. I just wanted to write code to get all the blogs from another portal ID.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sjay_1-1678454182270.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/87097i080591ED72C42097/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sjay_1-1678454182270.png" alt="sjay_1-1678454182270.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 13:18:26 GMT</pubDate>
    <dc:creator>sjay</dc:creator>
    <dc:date>2023-03-10T13:18:26Z</dc:date>
    <item>
      <title>how to Get all blogs using blog portal id</title>
      <link>https://community.hubspot.com/t5/CMS-Development/how-to-Get-all-blogs-using-blog-portal-id/m-p/767073#M33252</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me out with how to list all the blogs using the blog portal ID?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sjay_0-1678454104802.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/87096i7359B0D42D9F81EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sjay_0-1678454104802.png" alt="sjay_0-1678454104802.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;We can use contents, but I was using another template. I just wanted to write code to get all the blogs from another portal ID.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sjay_1-1678454182270.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/87097i080591ED72C42097/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sjay_1-1678454182270.png" alt="sjay_1-1678454182270.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 13:18:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/how-to-Get-all-blogs-using-blog-portal-id/m-p/767073#M33252</guid>
      <dc:creator>sjay</dc:creator>
      <dc:date>2023-03-10T13:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to Get all blogs using blog portal id</title>
      <link>https://community.hubspot.com/t5/CMS-Development/how-to-Get-all-blogs-using-blog-portal-id/m-p/767698#M33270</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/100080"&gt;@sjay&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Here's an example of how to get all the blogs using the HubSpot API and a blog portal ID:&lt;/P&gt;
&lt;P&gt;First, you'll need to get your API key from HubSpot. You can find instructions on how to do that here: &lt;A href="https://developers.hubspot.com/docs/api/overview" target="_blank"&gt;https://developers.hubspot.com/docs/api/overview&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Next, you'll need to make a GET request to the HubSpot Blogs API endpoint, passing in your API key and the blog portal ID you want to retrieve the blogs from. Here's an example using JavaScript and the axios library:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const axios = require('axios');

const apiKey = 'your_api_key_here';
const blogPortalId = 'your_blog_portal_id_here';

axios.get(`https://api.hubapi.com/blogs/v3/blog-posts?portalId=${blogPortalId}&amp;amp;hapikey=${apiKey}`)
  .then(response =&amp;gt; {
    const blogs = response.data.objects;
    console.log(blogs);
  })
  .catch(error =&amp;gt; {
    console.log(error);
  });&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code will make a GET request to the &lt;CODE&gt;/blogs/v3/blog-posts&lt;/CODE&gt; endpoint and retrieve all the blogs associated with the specified blog portal ID. The &lt;CODE&gt;response.data.objects&lt;/CODE&gt; property contains an array of blog objects, each with information such as the blog title, publish date, and author.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I hope this helps! Let me know if you have any other questions.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 07:24:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/how-to-Get-all-blogs-using-blog-portal-id/m-p/767698#M33270</guid>
      <dc:creator>himanshurauthan</dc:creator>
      <dc:date>2023-03-13T07:24:49Z</dc:date>
    </item>
  </channel>
</rss>

