# Access token and refresh token issue

**URL:** <https://community.hubspot.com/t/access-token-and-refresh-token-issue/35478>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [April 14, 2021, 6:19am UTC](https://community.hubspot.com/t/access-token-and-refresh-token-issue/35478 "2021-04-14T06:19:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AKumar6](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/akumar6/32/22074_2.png) [@AKumar6](https://community.hubspot.com/u/AKumar6)\
**Post date:** [April 14, 2021, 6:19am UTC](https://community.hubspot.com/t/access-token-and-refresh-token-issue/35478/1 "2021-04-14T06:19:37Z")

</div>

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 ?

 ![40856iB766FD881EDEE4CE.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/9/7980fab05f4f7d3d4552721f04ce35addd5f611c.png)

 ![40857iF0E707D908D892FD.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/e/dee7030baa11443108cf8dc5fd8d1e1006ac4b8d.png)

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [April 14, 2021, 3:41pm UTC](https://community.hubspot.com/t/access-token-and-refresh-token-issue/35478/2 "2021-04-14T15:41:41Z")

</div>

Hi @AKumar6

Might need more info, but adding @prosa to the conversation to assist!

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [April 15, 2021, 8:03am UTC](https://community.hubspot.com/t/access-token-and-refresh-token-issue/35478/3 "2021-04-15T08:03:03Z")

</div>

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](https://packagist.org/packages/hubspot/api-client) \*/

$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](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](https://developers.hubspot.com/docs/api/cms/hubdb)
