<?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 publish api in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/hubdb-publish-api/m-p/758893#M32931</link>
    <description>&lt;P&gt;Hmm two things to check:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Hubspot no longer allows the use of API keys, you have to use an access token from a private app. If you don't have that set up, you just need to set up a private app that has access to the hubdb scope. It will then generate a token for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Double check that the value of HUBDB_API is "&lt;A href="https://api.hubapi.com/cms/v3/hubdb/tables/&amp;quot;" target="_blank"&gt;https://api.hubapi.com/cms/v3/hubdb/tables/"&lt;/A&gt;&amp;nbsp;as the full URL to POST to should be "&lt;A href="https://api.hubapi.com/cms/v3/hubdb/tables/${HUBDB_TABLE_ID}/draft/publish" target="_blank"&gt;https://api.hubapi.com/cms/v3/hubdb/tables/${HUBDB_TABLE_ID}/draft/publish&lt;/A&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, this works for me:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function updateTable(tableId){
  let url = `https://api.hubapi.com/cms/v3/hubdb/tables/${tableId}/draft/publish`;
  return fetch(url, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'accept': 'application/json',
      'Content-Type': 'application/json'
    }
  })
  .then(response =&amp;gt; ({status: response.stats}));
}

Promise.all([
  updateTable([ID1])
  updateTable([ID2])
])
  .then(data =&amp;gt; doMoreThings(data))
  .catch(err =&amp;gt; console.log(err));&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Feb 2023 11:03:23 GMT</pubDate>
    <dc:creator>piersg</dc:creator>
    <dc:date>2023-02-21T11:03:23Z</dc:date>
    <item>
      <title>hubdb publish api</title>
      <link>https://community.hubspot.com/t5/CMS-Development/hubdb-publish-api/m-p/758831#M32926</link>
      <description>&lt;P&gt;I tried to publish the table via api, but either `draft/push-live` nor `draft/publish` work for me.&lt;BR /&gt;Anyone could help me or has any idea ?&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const publishTable = async auth =&amp;gt; {
  return await axios.post(
    `${HUBDB_API}/${HUBDB_TABLE_ID}/draft/publish`,
    {
      headers: {
        "Accept": "application/json",
        'Content-Type' : 'application/json',
        'Authorization' : `Bearer ${BIAPIKEY}`
      }
    }
  );
}&lt;/LI-CODE&gt;&lt;P&gt;`&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 07:31:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/hubdb-publish-api/m-p/758831#M32926</guid>
      <dc:creator>Shuweikuo</dc:creator>
      <dc:date>2023-02-21T07:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: hubdb publish api</title>
      <link>https://community.hubspot.com/t5/CMS-Development/hubdb-publish-api/m-p/758893#M32931</link>
      <description>&lt;P&gt;Hmm two things to check:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Hubspot no longer allows the use of API keys, you have to use an access token from a private app. If you don't have that set up, you just need to set up a private app that has access to the hubdb scope. It will then generate a token for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Double check that the value of HUBDB_API is "&lt;A href="https://api.hubapi.com/cms/v3/hubdb/tables/&amp;quot;" target="_blank"&gt;https://api.hubapi.com/cms/v3/hubdb/tables/"&lt;/A&gt;&amp;nbsp;as the full URL to POST to should be "&lt;A href="https://api.hubapi.com/cms/v3/hubdb/tables/${HUBDB_TABLE_ID}/draft/publish" target="_blank"&gt;https://api.hubapi.com/cms/v3/hubdb/tables/${HUBDB_TABLE_ID}/draft/publish&lt;/A&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, this works for me:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function updateTable(tableId){
  let url = `https://api.hubapi.com/cms/v3/hubdb/tables/${tableId}/draft/publish`;
  return fetch(url, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${token}`,
      'accept': 'application/json',
      'Content-Type': 'application/json'
    }
  })
  .then(response =&amp;gt; ({status: response.stats}));
}

Promise.all([
  updateTable([ID1])
  updateTable([ID2])
])
  .then(data =&amp;gt; doMoreThings(data))
  .catch(err =&amp;gt; console.log(err));&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 11:03:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/hubdb-publish-api/m-p/758893#M32931</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2023-02-21T11:03:23Z</dc:date>
    </item>
  </channel>
</rss>

