<?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: Files API Overwrite not behaving in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/594298#M51622</link>
    <description>&lt;P&gt;Oh yes... Seems to working! Fantastic!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2022 15:01:14 GMT</pubDate>
    <dc:creator>mike-thomas</dc:creator>
    <dc:date>2022-03-14T15:01:14Z</dc:date>
    <item>
      <title>Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/537006#M49215</link>
      <description>&lt;P&gt;Using&lt;BR /&gt;&lt;SPAN&gt;/files/v3/files/import-from-url/async&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;to pull an external file into hubspot files. This appears to work. However when the&amp;nbsp;&lt;SPAN&gt;overwrite&amp;nbsp;option is set to true, it doesn't overwrite, just end up with a folder with&amp;nbsp;&lt;BR /&gt;test&lt;BR /&gt;test-1&lt;BR /&gt;test-2&lt;BR /&gt;test-3&lt;BR /&gt;test-4&lt;BR /&gt;&lt;BR /&gt;Then for some reason, consistently after -4 it changes to test-datetime stamp&lt;BR /&gt;test-Dec-06-2021-02-39-17-81-AM&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Just running the below (where XXX = api key, file url, folderid)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL =&amp;gt; 'https://api.hubapi.com/files/v3/files/import-from-url/async?hapikey=XXX',
  CURLOPT_RETURNTRANSFER =&amp;gt; true,
  CURLOPT_ENCODING =&amp;gt; '',
  CURLOPT_MAXREDIRS =&amp;gt; 10,
  CURLOPT_TIMEOUT =&amp;gt; 0,
  CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =&amp;gt; 'POST',
  CURLOPT_POSTFIELDS =&amp;gt;'{
    "access":"PUBLIC_NOT_INDEXABLE",
    "name":"test",
    "url":"XXX",
    "duplicateValidationStrategy":"NONE",
    "duplicateValidationScope":"EXACT_FOLDER",
    "overwrite":true,
    "folderId":"XXX"
}',
  CURLOPT_HTTPHEADER =&amp;gt; array(
    'accept: application/json',
    'content-type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Just wanting it to overwrite anyone able to replicate the issue or able to point me in the right direction.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 02:44:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/537006#M49215</guid>
      <dc:creator>PNie</dc:creator>
      <dc:date>2021-12-06T02:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/537316#M49236</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/257209"&gt;@PNie&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can reproduce it, and have the same behaviour.&lt;/P&gt;
&lt;P&gt;It looks that the parameter overwrite is not accepted or ignored by the async API.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I found the following information&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Overwrite:
If true this file with replace any existing files with the name name, folder, and type.

Note: If this is set to false, and the uploaded file matches the filename of an existing file in the same folder, the file will be uploaded with a number incremented filename (e.g. example_file.txt will become example_file-1.txt)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file" target="_blank" rel="noopener"&gt;https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried is also with the synchronious endpoint, and that one is accepting the overwrite parameter and is updating the file with overwrite. (&lt;A href="https://api.hubapi.com/filemanager/api/v3/files/upload?hapikey=xxx" target="_blank"&gt;https://api.hubapi.com/filemanager/api/v3/files/upload?hapikey=xxx&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;can tell us if this function isn't implemented in the async API?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards Ronald&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 15:48:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/537316#M49236</guid>
      <dc:creator>RMones</dc:creator>
      <dc:date>2021-12-06T15:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/538868#M49296</link>
      <description>&lt;P&gt;Will look into this &lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 16:48:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/538868#M49296</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-12-08T16:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/541531#M49428</link>
      <description>&lt;P&gt;This issue is blocking me too&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 18:45:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/541531#M49428</guid>
      <dc:creator>mike-thomas</dc:creator>
      <dc:date>2021-12-13T18:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/570755#M50684</link>
      <description>&lt;P&gt;Any news on this issue? I'm still having issues with the overwrite option.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 14:01:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/570755#M50684</guid>
      <dc:creator>LCantos</dc:creator>
      <dc:date>2022-02-07T14:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/574998#M50845</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just checking to see if anyone found a resolution to this. I am running into the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 12 Feb 2022 15:24:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/574998#M50845</guid>
      <dc:creator>MDeladi</dc:creator>
      <dc:date>2022-02-12T15:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/594257#M51613</link>
      <description>&lt;P&gt;Any update on this one please&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 14:39:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/594257#M51613</guid>
      <dc:creator>mike-thomas</dc:creator>
      <dc:date>2022-03-14T14:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/594270#M51614</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/158266"&gt;@mike-thomas&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;Believe it or not, I received a message on Friday that this was resolved!&amp;nbsp; feel free to yell at me if it is still not working.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 14:45:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/594270#M51614</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-03-14T14:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/594298#M51622</link>
      <description>&lt;P&gt;Oh yes... Seems to working! Fantastic!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 15:01:14 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/594298#M51622</guid>
      <dc:creator>mike-thomas</dc:creator>
      <dc:date>2022-03-14T15:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/754956#M61359</link>
      <description>&lt;P&gt;Hi, i'm having a similar issue. I'm using&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;/files/v3/files/import-from-url/async&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in a serverless function to write a json file to a folder. Here's my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;const axios = require('axios');
exports.main = async (context, sendResponse) =&amp;gt; {
  const response = await axios.post(
      'https://api.hubapi.com/files/v3/files/import-from-url/async',
      {
          'access': 'PUBLIC_INDEXABLE',
          'name': 'MY_FILENAME.json',
          'url': 'MY_JSON_URL_TO_IMPORT',
          'folderPath': 'MY_FOLDER',
          'duplicateValidationStrategy': 'NONE',
          'duplicateValidationScope': 'ENTIRE_PORTAL',
          'overwrite': true
      },
      {
          headers: {
              'authorization': 'Bearer MY_TOKEN',
              'content-type': 'application/json'
          }
      }
  );
  sendResponse({body: JSON.stringify(response.data), statusCode: 200});
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The first time, it works fine. MY_FILENAME.json file is put in the folder, no problem. The second time I run it, Instead of overwriting the file, a new file is added to the folder with an extra .json extension added (e.g.MY_FILENAME.json.json). Any subsequent API calls will overwrite the MY_FILENAME.json.json file, but leaves the original MY_FILENAME.json file unchanged. Any help?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 21:48:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/754956#M61359</guid>
      <dc:creator>ghostcat</dc:creator>
      <dc:date>2023-02-10T21:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/778584#M62880</link>
      <description>&lt;P&gt;I have the same issue. Both API endpoints for overwritting and replacing the file just don't work ((&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 20:22:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/778584#M62880</guid>
      <dc:creator>lstepany</dc:creator>
      <dc:date>2023-04-05T20:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Files API Overwrite not behaving</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/778588#M62881</link>
      <description>&lt;P&gt;There are 2 API endpoint and the one that I use is defenitly not working ((&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://api.hubapi.com/filemanager/api/v3/files/upload" target="_blank"&gt;https://api.hubapi.com/filemanager/api/v3/files/upload&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Apr 2023 07:21:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Files-API-Overwrite-not-behaving/m-p/778588#M62881</guid>
      <dc:creator>lstepany</dc:creator>
      <dc:date>2023-04-06T07:21:51Z</dc:date>
    </item>
  </channel>
</rss>

