<?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 Issue with Uploading Images to HubSpot via API - FOLDER_DUPLICATE and Validation Errors in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Issue-with-Uploading-Images-to-HubSpot-via-API-FOLDER-DUPLICATE/m-p/1029370#M75957</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt; I'm working on a Python script that automates the uploading of images to specific folders in HubSpot. The process involves creating folders (if they don't exist) and uploading images into these folders.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; During the image upload process, I encounter a recurring issue where the API returns a 409 FOLDER_DUPLICATE error when attempting to upload multiple images to a folder that already exists. Even when I handle the existing folder case by retrying the upload without re-creating the folder, the process fails with various errors, including:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;409 FOLDER_DUPLICATE:&lt;/STRONG&gt; This occurs even after attempting to handle the folder's existence and retrying the upload without folder creation.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;400 VALIDATION_ERROR:&lt;/STRONG&gt; When omitting the folderPath to avoid the duplicate error, the API returns a 400 error indicating that either folderId or folderPath is required.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Key Errors Encountered:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;409 FOLDER_DUPLICATE Error:&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;{
    "status": "error",
    "message": "A folder already exists at this path",
    "errorType": "FOLDER_DUPLICATE",
    "errorTokens": {
        "fullPath": ["/library/docs_media/FolderName"],
        "id": ["176092833175"]
    },
    "correlationId": "9a28b68e-781c-491f-a527-8ff8fc19dd6f"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. 400 VALIDATION_ERROR:&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;{
    "status": "error",
    "message": "Either folderId or folderPath is required",
    "correlationId": "3f5a6a78-9917-4489-81c8-cb34bcc902dc",
    "context": {
        "folderId or folderPath": ["false"]
    },
    "category": "VALIDATION_ERROR"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I’ve Tried:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Retrying Upload Without Folder Creation:&lt;/STRONG&gt; After receiving the 409 FOLDER_DUPLICATE error, I attempted to retry the upload without specifying the folderPath, expecting the API to upload directly into the existing folder. However, this led to the 400 VALIDATION_ERROR, indicating that either folderId or folderPath is required.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Duplicate Validation Strategy:&lt;/STRONG&gt; I tried using duplicateValidationScope: "EXACT_FOLDER" and duplicateValidationStrategy: "RETURN_EXISTING" options, but these didn't resolve the issue.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Skipping folderPath on Retry:&lt;/STRONG&gt; Attempted to omit folderPath on the retry to prevent re-triggering the folder creation logic, but this also led to errors.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Is there a reliable way to manage folder existence and subsequent file uploads in HubSpot via the API?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;How can I correctly manage the folderPath to avoid FOLDER_DUPLICATE errors while ensuring all images are uploaded?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Are there best practices for handling such scenarios where multiple files need to be uploaded to the same folder in HubSpot?&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any insights or suggestions from the community would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Additional Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The script's goal is to upload a series of images to HubSpot, placing them in a designated folder structure.&lt;/LI&gt;&lt;LI&gt;Ensuring that all images are accessible and correctly placed in the specified folder is crucial for the process.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 05:35:42 GMT</pubDate>
    <dc:creator>SMourad7</dc:creator>
    <dc:date>2024-08-20T05:35:42Z</dc:date>
    <item>
      <title>Issue with Uploading Images to HubSpot via API - FOLDER_DUPLICATE and Validation Errors</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Issue-with-Uploading-Images-to-HubSpot-via-API-FOLDER-DUPLICATE/m-p/1029370#M75957</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt; I'm working on a Python script that automates the uploading of images to specific folders in HubSpot. The process involves creating folders (if they don't exist) and uploading images into these folders.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt; During the image upload process, I encounter a recurring issue where the API returns a 409 FOLDER_DUPLICATE error when attempting to upload multiple images to a folder that already exists. Even when I handle the existing folder case by retrying the upload without re-creating the folder, the process fails with various errors, including:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;409 FOLDER_DUPLICATE:&lt;/STRONG&gt; This occurs even after attempting to handle the folder's existence and retrying the upload without folder creation.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;400 VALIDATION_ERROR:&lt;/STRONG&gt; When omitting the folderPath to avoid the duplicate error, the API returns a 400 error indicating that either folderId or folderPath is required.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Key Errors Encountered:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;409 FOLDER_DUPLICATE Error:&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;{
    "status": "error",
    "message": "A folder already exists at this path",
    "errorType": "FOLDER_DUPLICATE",
    "errorTokens": {
        "fullPath": ["/library/docs_media/FolderName"],
        "id": ["176092833175"]
    },
    "correlationId": "9a28b68e-781c-491f-a527-8ff8fc19dd6f"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. 400 VALIDATION_ERROR:&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;{
    "status": "error",
    "message": "Either folderId or folderPath is required",
    "correlationId": "3f5a6a78-9917-4489-81c8-cb34bcc902dc",
    "context": {
        "folderId or folderPath": ["false"]
    },
    "category": "VALIDATION_ERROR"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I’ve Tried:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Retrying Upload Without Folder Creation:&lt;/STRONG&gt; After receiving the 409 FOLDER_DUPLICATE error, I attempted to retry the upload without specifying the folderPath, expecting the API to upload directly into the existing folder. However, this led to the 400 VALIDATION_ERROR, indicating that either folderId or folderPath is required.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Duplicate Validation Strategy:&lt;/STRONG&gt; I tried using duplicateValidationScope: "EXACT_FOLDER" and duplicateValidationStrategy: "RETURN_EXISTING" options, but these didn't resolve the issue.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Skipping folderPath on Retry:&lt;/STRONG&gt; Attempted to omit folderPath on the retry to prevent re-triggering the folder creation logic, but this also led to errors.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Is there a reliable way to manage folder existence and subsequent file uploads in HubSpot via the API?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;How can I correctly manage the folderPath to avoid FOLDER_DUPLICATE errors while ensuring all images are uploaded?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Are there best practices for handling such scenarios where multiple files need to be uploaded to the same folder in HubSpot?&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Any insights or suggestions from the community would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Additional Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The script's goal is to upload a series of images to HubSpot, placing them in a designated folder structure.&lt;/LI&gt;&lt;LI&gt;Ensuring that all images are accessible and correctly placed in the specified folder is crucial for the process.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 05:35:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Issue-with-Uploading-Images-to-HubSpot-via-API-FOLDER-DUPLICATE/m-p/1029370#M75957</guid>
      <dc:creator>SMourad7</dc:creator>
      <dc:date>2024-08-20T05:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Uploading Images to HubSpot via API - FOLDER_DUPLICATE and Validation Errors</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Issue-with-Uploading-Images-to-HubSpot-via-API-FOLDER-DUPLICATE/m-p/1030565#M76035</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A class="" href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/810472" target="_self" aria-label="View Profile of SMourad7" aria-describedby="userProfileCard-810472"&gt;&lt;SPAN class=""&gt;SMourad7!&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Thank you for all the details!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;Have you opened a technical support ticket? If so you can provide those details, as well as:&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Endpoint you're using and any documentation you're following&lt;/LI&gt;
&lt;LI&gt;API Header&lt;/LI&gt;
&lt;LI&gt;API Body&lt;/LI&gt;
&lt;LI&gt;Full Response/Error&lt;/LI&gt;
&lt;LI&gt;File ID that it's identifying as duplicated&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tagging in some API experts to see if they have insight otherwise!&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133120"&gt;@MatthiasWeber&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/241684"&gt;@ChrisoKlepke&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Jessie&lt;BR /&gt;Community Moderator&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 00:40:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Issue-with-Uploading-Images-to-HubSpot-via-API-FOLDER-DUPLICATE/m-p/1030565#M76035</guid>
      <dc:creator>JessieS</dc:creator>
      <dc:date>2024-08-22T00:40:12Z</dc:date>
    </item>
  </channel>
</rss>

