Do I ever need to refresh token?

Hi everyone,

I am using the Asana API with the Node.js Client API. My question is do I ever need to use my refresh token to get a new access token? When I create my client I pass both my access token and my refresh token into client.useOauth and that works well and lets me access the API. It seems like as long as I use the client even if my access token is expired as long as I pass in my refresh token it will still allow me to make API calls. If that is the case, do I ever need to use my refresh token to get a new access token?

The access token expires about once per hour and does need to be refreshed using the refresh token. However, the Node.js client library handles that internally for you; if it tries an API call and that call returns an “unauthorized” failure, the library does the refresh for you and then retries the call. So as long as you pass both tokens into the library, which you’re doing, then you’re all set.

1 Like