<?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: Using filters with PHP API Client in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/778801#M62897</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/175751"&gt;@TDwebdev&lt;/a&gt;&amp;nbsp;thanks for the quick response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the PHP API Client, though. Up until now I've written the cURL requests as you have above, but I'd like to utilise this new API client if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$client = Factory::createWithAccessToken(HUBSPOT_ACCESS_TOKEN);

$apiResponse = $client-&amp;gt;cms()-&amp;gt;blogs()-&amp;gt;blogPosts()-&amp;gt;blogPostsApi()-&amp;gt;getPage(PARAMS HERE);&lt;/LI-CODE&gt;&lt;P&gt;But the params available do not include any filtering other than basic timestamp data like updated_at, created_after, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 10:06:01 GMT</pubDate>
    <dc:creator>Craig</dc:creator>
    <dc:date>2023-04-06T10:06:01Z</dc:date>
    <item>
      <title>Using filters with PHP API Client</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/778483#M62875</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;Unless I'm missing something, there doesn't appear to be documentation for how to filter results when using the Blog Posts API via the PHP API Client.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see options for filtering &lt;A href="https://developers.hubspot.com/docs/api/cms/blog-post" target="_blank" rel="noopener"&gt;here&lt;/A&gt;, but these are for when using a request URL. When I view the 'Endpoints' tab and see the PHP examples for retrieving blog posts, there are only a few paramters that can be used - the state (draft/published, etc) isn't one of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked at the PHP API Client on &lt;A href="https://github.com/HubSpot/hubspot-api-php" target="_blank" rel="noopener"&gt;GitHub&lt;/A&gt; - but that gives a few basic examples for retrieving contacts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there more complete documentation somewhere?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 16:54:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/778483#M62875</guid>
      <dc:creator>Craig</dc:creator>
      <dc:date>2023-04-05T16:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using filters with PHP API Client</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/778724#M62892</link>
      <description>&lt;P&gt;Hi Craig,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what you want:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  $url = "https://api.hubapi.com/cms/v3/blogs/posts?sort=-updatedAt&amp;amp;&amp;amp;language__not_null&amp;amp;limit=10&amp;amp;offset=1";

                $header = array(
                    'Content-Type: application/json',
                    'authorization: Bearer ' . $bearer
                );

                $ch = curl_init();
                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                $result = curl_exec($ch);&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Apr 2023 06:19:10 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/778724#M62892</guid>
      <dc:creator>TDwebdev</dc:creator>
      <dc:date>2023-04-06T06:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using filters with PHP API Client</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/778801#M62897</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/175751"&gt;@TDwebdev&lt;/a&gt;&amp;nbsp;thanks for the quick response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the PHP API Client, though. Up until now I've written the cURL requests as you have above, but I'd like to utilise this new API client if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$client = Factory::createWithAccessToken(HUBSPOT_ACCESS_TOKEN);

$apiResponse = $client-&amp;gt;cms()-&amp;gt;blogs()-&amp;gt;blogPosts()-&amp;gt;blogPostsApi()-&amp;gt;getPage(PARAMS HERE);&lt;/LI-CODE&gt;&lt;P&gt;But the params available do not include any filtering other than basic timestamp data like updated_at, created_after, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 10:06:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/778801#M62897</guid>
      <dc:creator>Craig</dc:creator>
      <dc:date>2023-04-06T10:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using filters with PHP API Client</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/784549#M63323</link>
      <description>&lt;P&gt;To add to this post - I'm also seeing no way of specifying which blog to use. With the blog tags API using the PHP API Client, there doesn't seem to be a way to specify which blog to obtain tags from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this not documented anywhere?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 16:53:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/784549#M63323</guid>
      <dc:creator>Craig</dc:creator>
      <dc:date>2023-04-20T16:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using filters with PHP API Client</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/829695#M66189</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've the same issue,&amp;nbsp;&lt;SPAN&gt;I'm doing a request using the following code:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;$this-&amp;gt;client-&amp;gt;cms()-&amp;gt;blogs()-&amp;gt;blogPosts()-&amp;gt;blogPostsApi()-&amp;gt;getPage(...)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I add params to the request in order to do some filtering? For example, I need to do the following request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;https://api.hubapi.com/cms/v3/blogs/posts?contentGroupId=XXXX&amp;amp;state=PUBLISHED&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to filter the posts using the package&amp;nbsp;&lt;A href="https://github.com/HubSpot/hubspot-api-php" target="_blank"&gt;https://github.com/HubSpot/hubspot-api-php&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 08:04:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Using-filters-with-PHP-API-Client/m-p/829695#M66189</guid>
      <dc:creator>psjavi</dc:creator>
      <dc:date>2023-08-04T08:04:18Z</dc:date>
    </item>
  </channel>
</rss>

