I am getting access token and refresh token from api but i cant able to insert to my hubspot database is there any solution for this issue ?
Hello @AKumar6 ,
If you want to add your data inside your Hubspot HubDb then you have to first create the table inside hubdb. you can create hubdb manually inside your hubspot account or you can use api.
after creating the hubdb table and specifying your columns you can use this code to add new row inside your hubdb table.
<?php
/* hubspot/api-client - Packagist.org */
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => “https://api.hubapi.com/cms/v3/hubdb/tables/tableIdOrName/rows?hapikey=YOUR_HUBSPOT_API_KEY”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => “{\“path\”:\“test_path\”,\“childTableId\”:\“1902373\”,\“values\”:{\“multiselect\”:[{\“id\”:\“1\”,\“name\”:\“Option 1\”,\“type\”:\“option\”},{\“id\”:\“2\”,\“name\”:\“Option 2\”,\“type\”:\“option\”}],\“number_column\”:76,\“text_column\”:\“sample text value\”},\“name\”:\“test_title\”}”,
CURLOPT_HTTPHEADER => array(
“accept: application/json”,
“content-type: application/json”
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}
you can refer to this documentation for More Info. Accounts Dashboard | HubSpot

