I tried API Integration with Contacts API and tried testing it through postman.
const hubspot = require(‘@hubspot/api-client’)
const express = require(‘express’)
const app = express()
app.use(express.json())
const fs = require(‘fs’)
app.post(‘/add’, async function (req, res) {
try {
const contactObj = {
properties: {
firstname: "AnyName ",
lastname: “AnyName2”,
},
}
const companyObj = {
properties: {
domain: ‘Any1’,
name: “Any2”,
},
}
const hubspotClient = new hubspot.Client({ apiKey: ‘88ba97a7-67bb-42b6-a888-2effa2b-----’ })
const createContactResponse = await hubspotClient.crm.contacts.basicApi.create(contactObj)
const createCompanyResponse = await hubspotClient.crm.companies.basicApi.create(companyObj)
const result = await hubspotClient.crm.companies.associationsApi.create(
createCompanyResponse.body.id,
‘contacts’,
createContactResponse.body.id,
‘company_to_contact’
)
res.send(result)
} catch (err) {
res.send({ message: ‘error’, err: err })
}
})
But, when I test it in Postman I get an error for scopes:
I have already added these scopes in my App Auth as well.
But I’m still getting the same error. Can anyone help me please I’m new to this…?

