<?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: [HubDB API] how to add Foreign ID type columns to table in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/555246#M50053</link>
    <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt;&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;
&lt;P&gt;Thank you for the response.&lt;/P&gt;
&lt;P&gt;But it didn`t work for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found solution.&lt;/P&gt;
&lt;P&gt;I just added "foreignTableId" property to column object, and it worked.&lt;/P&gt;
&lt;P&gt;Here is request log&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --request POST \
  --url 'https://api.hubapi.com/cms/v3/hubdb/tables?hapikey={{API_KEY}}' \
  --header 'content-type: application/json' \
  --data '{
  "name": "test_table",
  "label": "Test Table",
  "useForPages": true,
  "columns": [
    {
      "name": "text_column",
      "label": "Text Column",
      "id": "1",
      "type": "FOREIGN_ID",
      "foreignTableId": 5316197,
      "foreignColumnId": 1
    }
  ],
  "allowChildTables": true,
  "enableChildTablePages": false,
  "allowPublicApiAccess": false
}'&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 13 Jan 2022 02:54:15 GMT</pubDate>
    <dc:creator>kaoki</dc:creator>
    <dc:date>2022-01-13T02:54:15Z</dc:date>
    <item>
      <title>[HubDB API] how to add Foreign ID type columns to table</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/554675#M50020</link>
      <description>&lt;P&gt;Hi, I`m using HubDB API .&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/api/cms/hubdb" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/api/cms/hubdb&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to create table which has a Foreign ID type column, and I got following error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;HTTP 400

Foreign table id must be defined: {name='text_column', label=Text Column, type=FOREIGN_ID, id=1, deleted=false, options=[], foreignTableId0, width=null}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an entire request log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;curl --request POST \
  --url 'https://api.hubapi.com/cms/v3/hubdb/tables?hapikey={{API_KEY}}' \
  --header 'content-type: application/json' \
  --data '{
  "name": "test_table",
  "label": "Test Table",
  "useForPages": true,
  "columns": [
    {
      "name": "text_column",
      "label": "Text Column",
      "id": "1",
      "type": "FOREIGN_ID"
    }
  ],
  "allowChildTables": true,
  "enableChildTablePages": false,
  "allowPublicApiAccess": false
}'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that the error occurs because I don`t specify foreign table id.&lt;/P&gt;
&lt;P&gt;I read the API documents but I didn`t found out how to specify it.&lt;/P&gt;
&lt;P&gt;How do I specify foreign table id?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 11:36:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/554675#M50020</guid>
      <dc:creator>kaoki</dc:creator>
      <dc:date>2022-01-12T11:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: [HubDB API] how to add Foreign ID type columns to table</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/555098#M50046</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt; , think you could assist here?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 21:10:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/555098#M50046</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-01-12T21:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: [HubDB API] how to add Foreign ID type columns to table</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/555203#M50052</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/148731"&gt;@kaoki&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;the foreign id column should be an array with objects inside of it since you can have multiple IDs in that field. So, for example the log should look more like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --request POST \
  --url 'https://api.hubapi.com/cms/v3/hubdb/tables?hapikey={{API_KEY}}' \
  --header 'content-type: application/json' \
  --data '{
  "name": "test_table",
  "label": "Test Table",
  "useForPages": true,
  "columns": [
    {
      "name": "text_column" [
        {
          "id": "1",
          "type": "foreignid"
        },
        {
          "id": "2",
          "type": "foreignid"
        }
      ]
    }
  ],
  "allowChildTables": true,
  "enableChildTablePages": false,
  "allowPublicApiAccess": false
}'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 00:51:18 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/555203#M50052</guid>
      <dc:creator>stefen</dc:creator>
      <dc:date>2022-01-13T00:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: [HubDB API] how to add Foreign ID type columns to table</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/555246#M50053</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/133"&gt;@stefen&lt;/a&gt;&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;
&lt;P&gt;Thank you for the response.&lt;/P&gt;
&lt;P&gt;But it didn`t work for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found solution.&lt;/P&gt;
&lt;P&gt;I just added "foreignTableId" property to column object, and it worked.&lt;/P&gt;
&lt;P&gt;Here is request log&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --request POST \
  --url 'https://api.hubapi.com/cms/v3/hubdb/tables?hapikey={{API_KEY}}' \
  --header 'content-type: application/json' \
  --data '{
  "name": "test_table",
  "label": "Test Table",
  "useForPages": true,
  "columns": [
    {
      "name": "text_column",
      "label": "Text Column",
      "id": "1",
      "type": "FOREIGN_ID",
      "foreignTableId": 5316197,
      "foreignColumnId": 1
    }
  ],
  "allowChildTables": true,
  "enableChildTablePages": false,
  "allowPublicApiAccess": false
}'&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Jan 2022 02:54:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubDB-API-how-to-add-Foreign-ID-type-columns-to-table/m-p/555246#M50053</guid>
      <dc:creator>kaoki</dc:creator>
      <dc:date>2022-01-13T02:54:15Z</dc:date>
    </item>
  </channel>
</rss>

