# Getting Started with APIs

**URL:** <https://community.hubspot.com/t/getting-started-with-apis/96773>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [December 27, 2023, 3:10pm UTC](https://community.hubspot.com/t/getting-started-with-apis/96773 "2023-12-27T15:10:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CClokeBrowne](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cclokebrowne/32/201039_2.png) [@CClokeBrowne](https://community.hubspot.com/u/CClokeBrowne)\
**Post date:** [December 27, 2023, 3:10pm UTC](https://community.hubspot.com/t/getting-started-with-apis/96773/1 "2023-12-27T15:10:56Z")

</div>

Really basic question.

I am looking to get started with API cqalls so that I can set line item values in bespoke code in workflows.

I have set up a private app and I have an access token. I then add the following to my bespoke code -

--

const hubspot = require(‘hubspot/api-client’);

exports.main = async (event, callback) =\> {

const hubspotClient = new hubspot.Client({accessToken: pat-na1-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX});

--

The XXX represent hexadecimal numbers.  
This ccreeates a parse error in the bespoke code - 5:72 Parsing error: Invalid number

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 27, 2023, 6:15pm UTC](https://community.hubspot.com/t/getting-started-with-apis/96773/2 "2023-12-27T18:15:04Z")

</div>

Hey, @CClokeBrowne 👋 Did you get this resolved?

If not, it looks like a formatting issue. You’re missing single or double quotes around your token. When using a string in JavaScript, you need to ensure that it is enclosed in quotes. So, something like this:

```lia-code-sample
const hubspot = require('@hubspot/api-client');
exports.main = async (event, callback) => {
 const hubspotClient = new hubspot.Client({ accessToken: 'pat-na1-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' });
 // Your awesome code here...
}

```

Have fun building! — Jaycee

---

<div class="post-metadata">

**Author:** ![CClokeBrowne](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cclokebrowne/32/201039_2.png) [@CClokeBrowne](https://community.hubspot.com/u/CClokeBrowne)\
**Post date:** [December 27, 2023, 6:16pm UTC](https://community.hubspot.com/t/getting-started-with-apis/96773/3 "2023-12-27T18:16:52Z")

</div>

Thany you - Your solution makes sense. I did regt it resolced by adding a SECRET and putting my key in there.
