hubdb publish api

I tried to publish the table via api, but either `draft/push-live` nor `draft/publish` work for me.
Anyone could help me or has any idea ?:folded_hands::folded_hands::folded_hands::folded_hands::folded_hands::folded_hands::folded_hands::folded_hands:

const publishTable = async auth => {
 return await axios.post(
 `${HUBDB_API}/${HUBDB_TABLE_ID}/draft/publish`,
 {
 headers: {
 "Accept": "application/json",
 'Content-Type' : 'application/json',
 'Authorization' : `Bearer ${BIAPIKEY}`
 }
 }
 );
}

`

Hmm two things to check:

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.

2. Double check that the value of HUBDB_API is β€œhttps://api.hubapi.com/cms/v3/hubdb/tables/” as the full URL to POST to should be β€œhttps://api.hubapi.com/cms/v3/hubdb/tables/${HUBDB_TABLE_ID}/draft/publish”

For reference, this works for me:

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 => ({status: response.stats}));
}

Promise.all([
 updateTable([ID1])
 updateTable([ID2])
])
 .then(data => doMoreThings(data))
 .catch(err => console.log(err));