<?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: SimplePublicObjectInput Not Found in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/SimplePublicObjectInput-Not-Found/m-p/665219#M54817</link>
    <description>&lt;P&gt;Yeah&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/281441"&gt;@MPenn6&lt;/a&gt;&amp;nbsp;I'm not speaking on behalf of HubSpot, using directly the appropriate namespace is the standard way to do it with the V3. Example for the contact :&lt;/P&gt;&lt;PRE&gt;$SimplePublicObjectInput = new \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput([ 'properties' =&amp;gt; $properties ]);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't recommend to call it from the &lt;EM&gt;use&lt;/EM&gt; statement as multiple models would probably create a conflict anyway. &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt; Anyone with more advanced skills is welcome to correct me&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yeah that means all the PHP snippets provided from the documentation do not work if you just copy-paste them :&lt;/P&gt;&lt;P&gt;Ex:&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/contacts" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/api/crm/contacts&lt;/A&gt;&amp;nbsp;(Endpoints tab)&lt;/P&gt;&lt;P&gt;Don't forget you need to tune at least the object input to make it work&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":tired_face:"&gt;😫&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 14:29:24 GMT</pubDate>
    <dc:creator>ph_alti_trading</dc:creator>
    <dc:date>2022-07-14T14:29:24Z</dc:date>
    <item>
      <title>SimplePublicObjectInput Not Found</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/SimplePublicObjectInput-Not-Found/m-p/536225#M49191</link>
      <description>&lt;P&gt;Using the PHP hubspot/api-client composer package.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;composer require hubspot/api-client&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most API calls have been working great, but I'm running into some issues with Line Items. I'm basing my code off of the samples from here: &lt;A href="https://developers.hubspot.com/docs/api/crm/line-items" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/api/crm/line-items&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm finding that &lt;STRONG&gt;SimplePublicObjectInput&lt;/STRONG&gt; is not a defined object. I'm not seeing anybody else with this issue, so I'm guessing I am overlooking something obvious! Here's my code snippet:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;use HubSpot\Factory;
use HubSpot\Client\Crm\LineItems\ApiException;

class lineitem
{
private function hs_createNewTaxLineItem()
    {
        $client = Factory::createWithApiKey(HUBSPOT_API_KEY);

       
        $properties = [
            "hs_product_id" =&amp;gt; HS_SALES_TAX_PRODUCT_ID,
            "quantity" =&amp;gt; "1",
            "price" =&amp;gt; 99.98
        ];
        $SimplePublicObjectInput = new SimplePublicObjectInput(['properties' =&amp;gt; $properties]);
        try {
            $apiResponse = $client-&amp;gt;crm()-&amp;gt;lineItems()-&amp;gt;basicApi()-&amp;gt;create($SimplePublicObjectInput);
            var_dump($apiResponse);
        } catch (ApiException $e) {
            echo "Exception when calling basic_api-&amp;gt;create: ", $e-&amp;gt;getMessage();
        }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It returns the error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;Fatal error: Uncaught Error: Class 'SimplePublicObjectInput' not found in...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 16:11:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/SimplePublicObjectInput-Not-Found/m-p/536225#M49191</guid>
      <dc:creator>MPenn6</dc:creator>
      <dc:date>2021-12-03T16:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: SimplePublicObjectInput Not Found</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/SimplePublicObjectInput-Not-Found/m-p/536242#M49192</link>
      <description>&lt;P&gt;Playing around with this a little more....&lt;/P&gt;&lt;P&gt;This does NOT work for creating the object:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$SimplePublicObjectInput = new SimplePublicObjectInput(['properties' =&amp;gt; $properties]);&lt;/LI-CODE&gt;&lt;P&gt;But I CAN create the object like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$SimplePublicObjectInput =  new \HubSpot\Client\Crm\LineItems\Model\SimplePublicObjectInput(['properties' =&amp;gt; $properties]);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Is this normal way to code this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only other way I can access this object is if I literally specify it in the use statement&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;use HubSpot\Client\Crm\LineItems\Model\SimplePublicObjectInput;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 16:29:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/SimplePublicObjectInput-Not-Found/m-p/536242#M49192</guid>
      <dc:creator>MPenn6</dc:creator>
      <dc:date>2021-12-03T16:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: SimplePublicObjectInput Not Found</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/SimplePublicObjectInput-Not-Found/m-p/665219#M54817</link>
      <description>&lt;P&gt;Yeah&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/281441"&gt;@MPenn6&lt;/a&gt;&amp;nbsp;I'm not speaking on behalf of HubSpot, using directly the appropriate namespace is the standard way to do it with the V3. Example for the contact :&lt;/P&gt;&lt;PRE&gt;$SimplePublicObjectInput = new \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInput([ 'properties' =&amp;gt; $properties ]);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't recommend to call it from the &lt;EM&gt;use&lt;/EM&gt; statement as multiple models would probably create a conflict anyway. &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt; Anyone with more advanced skills is welcome to correct me&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yeah that means all the PHP snippets provided from the documentation do not work if you just copy-paste them :&lt;/P&gt;&lt;P&gt;Ex:&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/contacts" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/api/crm/contacts&lt;/A&gt;&amp;nbsp;(Endpoints tab)&lt;/P&gt;&lt;P&gt;Don't forget you need to tune at least the object input to make it work&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":tired_face:"&gt;😫&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 14:29:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/SimplePublicObjectInput-Not-Found/m-p/665219#M54817</guid>
      <dc:creator>ph_alti_trading</dc:creator>
      <dc:date>2022-07-14T14:29:24Z</dc:date>
    </item>
  </channel>
</rss>

