<?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 FileManager API: curl_exec displays objects in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/590493#M51459</link>
    <description>&lt;P&gt;Hey guys!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just ran into the following problem: I am using the FileManager API in order to upload documents which ultimately will be connected to a contact (&lt;A href="https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file" target="_blank"&gt;https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file&lt;/A&gt;). For this, I am using &lt;STRONG&gt;PHP 7.4&lt;/STRONG&gt;, following precisely the instructions given in the above-mentioned page. For whatever reason, the &lt;STRONG&gt;$response = @curl_exec($ch);&lt;/STRONG&gt; leads to the object being displayed on the screen, instead of being stored in the variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Bildschirmfoto 2022-03-08 um 17.17.52.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/61196i0D862BFBADA76C1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2022-03-08 um 17.17.52.png" alt="Bildschirmfoto 2022-03-08 um 17.17.52.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hence, I cannot json_decode the response and also not use the information at all; in the end, I just require the friendly URL to attach it to contact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know why this is the case? As far as I know, it worked fine beforehand (I used the same code some time last year). Thank you very much in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Mino.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2022 16:19:29 GMT</pubDate>
    <dc:creator>Compounder</dc:creator>
    <dc:date>2022-03-08T16:19:29Z</dc:date>
    <item>
      <title>FileManager API: curl_exec displays objects</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/590493#M51459</link>
      <description>&lt;P&gt;Hey guys!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just ran into the following problem: I am using the FileManager API in order to upload documents which ultimately will be connected to a contact (&lt;A href="https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file" target="_blank"&gt;https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file&lt;/A&gt;). For this, I am using &lt;STRONG&gt;PHP 7.4&lt;/STRONG&gt;, following precisely the instructions given in the above-mentioned page. For whatever reason, the &lt;STRONG&gt;$response = @curl_exec($ch);&lt;/STRONG&gt; leads to the object being displayed on the screen, instead of being stored in the variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Bildschirmfoto 2022-03-08 um 17.17.52.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/61196i0D862BFBADA76C1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2022-03-08 um 17.17.52.png" alt="Bildschirmfoto 2022-03-08 um 17.17.52.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hence, I cannot json_decode the response and also not use the information at all; in the end, I just require the friendly URL to attach it to contact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know why this is the case? As far as I know, it worked fine beforehand (I used the same code some time last year). Thank you very much in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Mino.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 16:19:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/590493#M51459</guid>
      <dc:creator>Compounder</dc:creator>
      <dc:date>2022-03-08T16:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: FileManager API: curl_exec displays objects</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/591235#M51496</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/154476"&gt;@RMones&lt;/a&gt; , curious if you have had a similar issue &lt;span class="lia-unicode-emoji" title=":eyes:"&gt;👀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 16:29:33 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/591235#M51496</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-03-09T16:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: FileManager API: curl_exec displays objects</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/591382#M51509</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/146120"&gt;@Compounder&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a paramter missing in the example for getting the data in the variable instead of the stdout..&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.php.net/manual/en/function.curl-setopt.php" target="_blank"&gt;https://www.php.net/manual/en/function.curl-setopt.php&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;CURLOPT_RETURNTRANSFER &lt;BR /&gt;true to return the transfer as a string of the return value of curl_exec() instead of outputting it directly.&lt;BR /&gt;&lt;BR /&gt;So if you add the following line:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;curl_setopt&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$ch&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CURLOPT_POSTFIELDS&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;$post_data&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;The data will be passed to the variable!&lt;BR /&gt;&lt;BR /&gt;Good luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards Ronald&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 19:05:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/591382#M51509</guid>
      <dc:creator>RMones</dc:creator>
      <dc:date>2022-03-09T19:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: FileManager API: curl_exec displays objects</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/591832#M51521</link>
      <description>&lt;P&gt;Oh my, could have found that on my own when just scrolling down within my own script, where I am doing the cURL for the ContactAPI &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; cheers, Ronald!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 08:28:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/FileManager-API-curl-exec-displays-objects/m-p/591832#M51521</guid>
      <dc:creator>Compounder</dc:creator>
      <dc:date>2022-03-10T08:28:36Z</dc:date>
    </item>
  </channel>
</rss>

