Oauth2 Refresh Token HubSpot

Hi,

I have a HTTP Node with Predefined Credential type and HubSpot Developer Type connected.
And i don´t know why after XX minutes i receive a response:
( So don´t know where is the problem) any help will be great! thanks in advance

The OAuth token used to make this call expired 26 minute(s) ago.

Details

Search deals associated

Execute node

Parameters


Docs

Authentication

Credential Type

6 scopes available for HubSpot Developer API credentials

Credential for HubSpot Developer API

Request Method

Fixed

Expression

URL

Fixed

Expression

Ignore SSL Issues

Fixed

Expression

Response Format

Fixed

Expression

JSON/RAW Parameters

Fixed

Expression

Options

No properties

Send Binary Data

Fixed

Expression

Body Parameters

Fixed

Expression

Headers

Fixed

Expression

Query Parameters

Fixed

Expression

I wish this node would…

Hey Juan,
it looks like you tried to post you workflow json but you only pasted the text somehow. Can you post your workflow json here and put it inside ``` like this

```
json
```

```{“status”:“rejected”,“reason”:{“context”:{},“name”:“NodeApiError”,“cause”:{“message”:“401 - {"status":"error","message":"The OAuth token used to make this call expired 27 minute(s) ago.","correlationId":"a464a630-58e2-4f69-a5b3-90c252b44d3f","category":"EXPIRED_AUTHENTICATION","context":{"expire time":["2022-09-29T19:16:03.420Z"]}}”,“name”:“Error”,“stack”:“Error: Request failed with status code 401\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”},“timestamp”:1664480584187,“message”:“Authorization failed - please check your credentials”,“node”:{“parameters”:{“authentication”:“predefinedCredentialType”,“nodeCredentialType”:“hubspotDeveloperApi”,“requestMethod”:“POST”,“url”:“=https://api.hubapi.com/crm/v3/objects/deals/search",“allowUnauthorizedCerts”:false,“responseFormat”:“json”,“jsonParameters”:true,“options”:{},“sendBinaryData”:false,“bodyParametersJson”:"={\n "filters": [\n {\n "propertyName": "associations.contact",\n "operator": "EQ",\n "value": "{{$node["Start"].json["vid"]}}"\n }\n ]\n }”,“headerParametersJson”:“”,“queryParametersJson”:“”},“id”:“24fe0896-a562-443e-b55b-0a7265e54c0f”,“name”:“Search deals associated”,“type”:“n8n-nodes-base.httpRequest”,“typeVersion”:2,“position”:[1480,80],“retryOnFail”:true,“notesInFlow”:true,“credentials”:{“hubspotDeveloperApi”:{“id”:“22”,“name”:“Hubspot Developer Account produccion v2”},“hubspotOAuth2Api”:{“id”:“17”,“name”:“HubSpot account 2”}},“notes”:“Activado re-intentar con 1 segundo de espera.”},“httpCode”:“401”,“description”:“The OAuth token used to make this call expired 27 minute(s) ago.”}} ````

Hey @Juan_Pablo_Sanchez,

How often was the workflow running and what version of n8n are you running?

every day,
N8N V is 0.192.2
thanks!

Hi , any news about this :wink: thanks

Hey @Juan_Pablo_Sanchez,

Nothing yet, I want to set up a test workflow but have not had a chance to yet. How long does it take for this error to occur?

aprox 15-20 minutes from Syncronization .

Alright that does sound like a bigger problem, The Dev token for hubspot has a life span of 30 minutes so it sounds like the refresh isn’t getting triggered.

@RicardoE105 do you have any thoughts on this one?

1 Like

Saw the issue. It should be quick to fix. I will share it with Jon so he can send a PR.

2 Likes

Hi just a kindly follow up on this as at this point we can´t use this node without manual update and only for the small period of time.

thanks

1 Like

The fix got merged today. It will be available in the next release.

6 Likes