<?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 Re: contentsearch API returning nothing for private/membership blog in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568022#M50562</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Any help you can offer?&lt;/P&gt;</description>
    <pubDate>Wed, 02 Feb 2022 19:01:26 GMT</pubDate>
    <dc:creator>dennisedson</dc:creator>
    <dc:date>2022-02-02T19:01:26Z</dc:date>
    <item>
      <title>contentsearch API returning nothing for private/membership blog</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/566250#M50508</link>
      <description>&lt;P&gt;Is there a setting/field that I need to add in order for private/membership required pages to show in the contentsearch api results?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can retrieve the pages that are indexed via the get index properties:&lt;/P&gt;&lt;P&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/content/get-indexed-properties" target="_blank" rel="noopener"&gt;https://legacydocs.hubspot.com/docs/methods/content/get-indexed-properties&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I know that the blog pages are being indexed. But when I do a search (yes, while logged in), the results show no results (total: 0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search works fine on non-private blogs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Standard search query I'm using.&lt;/P&gt;&lt;P&gt;&lt;A href="https://api.hubapi.com/contentsearch/v2/search?portalId=XXXXXX&amp;amp;groupId=YYYY&amp;amp;term=trends" target="_blank" rel="noopener"&gt;https://api.hubapi.com/contentsearch/v2/search?portalId=XXXXXX&amp;amp;groupId=YYYY&amp;amp;term=trends&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 15:20:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/566250#M50508</guid>
      <dc:creator>MichaelMa</dc:creator>
      <dc:date>2022-01-31T15:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: contentsearch API returning nothing for private/membership blog</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568022#M50562</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Any help you can offer?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 19:01:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568022#M50562</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-02-02T19:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: contentsearch API returning nothing for private/membership blog</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568069#M50564</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/321717"&gt;@MichaelMa&lt;/a&gt;&amp;nbsp;as far as I know, the HubSpot crawler behaves exactly like a Google crawler in that it will only index public pages and also adheres to the robots.txt file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That would be something you should post to the Ideas board and try to get some upvotes on. Technically it should be possible.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 20:17:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568069#M50564</guid>
      <dc:creator>stefen</dc:creator>
      <dc:date>2022-02-02T20:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: contentsearch API returning nothing for private/membership blog</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568071#M50565</link>
      <description>&lt;P&gt;The documentation under "&lt;SPAN&gt;Default indexing behavior":&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/cms/features/content-search" target="_blank"&gt;https://developers.hubspot.com/docs/cms/features/content-search&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CMS Membership restricted pages will only display in hubspot content search for users that are signed in and have access to the pages.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Which seems to indicate otherwise.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 20:25:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568071#M50565</guid>
      <dc:creator>MichaelMa</dc:creator>
      <dc:date>2022-02-02T20:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: contentsearch API returning nothing for private/membership blog</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568537#M50577</link>
      <description>&lt;P&gt;So I'm not sure if I found THE solution but I found a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Documentation for contentsearch API:&lt;/P&gt;&lt;P&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/content/search-for-content" target="_blank"&gt;https://legacydocs.hubspot.com/docs/methods/content/search-for-content&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which basically shows using the endpoint:&lt;/P&gt;&lt;P&gt;&lt;A href="https://api.hubapi.com/contentsearch/v2/search?portalId=62515&amp;amp;term=hubspot" target="_blank"&gt;https://api.hubapi.com/contentsearch/v2/search?portalId=62515&amp;amp;term=hubspot&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, one thing I noticed in the difference between the custom theme we paid hubspot to make and the marketplace theme we purchased was the end point. One of our blogs is public and uses the custom theme we paid hubspot to build. The other blog, which we're having issues with, is private/gated and uses the market place theme.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end point hubspot theme uses is (replace subdomain/domain with your blog domain):&lt;/P&gt;&lt;P&gt;&lt;A href="https://subdomain.domain.com/_hcms/search" target="_blank"&gt;https://subdomain.domain.com/_hcms/search&lt;/A&gt;&lt;/P&gt;&lt;P&gt;eg,&amp;nbsp;&lt;A href="https://subdomain.domain.com/_hcms/search?portalId=62515&amp;amp;term=hubspot" target="_blank"&gt;https://subdomain.domain.com/_hcms/search?portalId=62515&amp;amp;term=hubspot&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cloning the theme to a child theme and modifying the search endpoint to the same format as the one hubspot theme uses returns the same JSON response as the normal contentsearch API. It even converts the subdomain/domain combo into&amp;nbsp;&amp;amp;domain= query variable found in the cachekey. More importantly, it works for private content if you're logged in! If you're logged out, it shows the same response as the normal endpoint (no content).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a pure guess, I'm thinking that the reason the main endpoint doesn't show data is because of a Cross-Origin Resource Sharing (CORS) issue. Aka, the hubspot endpoint domain doesn't not have permissions to access the cookie data in the domain you set up for the blog.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps anyone else having this issue. I know I searched for any direction for a few days before stumbling upon this "solution".&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 13:36:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/contentsearch-API-returning-nothing-for-private-membership-blog/m-p/568537#M50577</guid>
      <dc:creator>MichaelMa</dc:creator>
      <dc:date>2022-02-03T13:36:33Z</dc:date>
    </item>
  </channel>
</rss>

