contacts.getByToken is returning contacts false / contacts.get() returning small subset of contacts
Hi there,
We have built an integration with Hubspot that looks up contacts using the hubspotutk cookie. It is returning contact = false for every lookup, even ones that represent a conversion event like filling out a form. I thought this was strange so I tested the hubspot.contacts.get() method to see what would come back and it only returned contacts that had been manually entered offline, a small subset of the actual contacts in the system.
We are using the node-hubspot library and authenticating via oauth (see below code). Any ideas as to what could be going on / how this can be fixed?
//Get Contact Info using hutk code
return hubspot.refreshAccessToken()
.then(results => {
console.log(results.access_token)
console.log(hubspot.accessToken) // this assigns the new accessToken to the client, so your client is ready to use
return hubspot.contacts.getByToken(“hutkgoeshere”)
.then(results => {
console.log(results)
}).catch(err => {
console.error(err)
})
})
//Get All Contacts Code
return hubspot.refreshAccessToken()
.then(results => {
console.log(results.access_token)
console.log(hubspot.accessToken) // this assigns the new accessToken to the client, so your client is ready to use
return hubspot.contacts.get()
.then(results => {
console.log(results)
}).catch(err => {
console.error(err)
})
})