Setting up Plytix refresh token

Good evening everyone!

New user here transferring over from Celigo. I just need a bit of help setting up the refresh token for Plytix. It refreshes every 15 minutes. What would be the best way to set that up on n8n to be used for multiple flows? Thank you! and sorry if the question has been asked before!

Hi @Shadner_Joseph

Thanks for posting here and welcome to the community! :cupcake:

You can use the HTTP request node to connect to the Plytix API and by default tokens should refresh automatically. So if we get a failed response back on the request we then do a refresh of the token.

You can also find related information in this post: OAuth2 token refreshing

:bulb: Tipp: Try out our new feature AskAI when creating your HTTP Request node to Plytix. (available on version 1.40)

Let us know how you get on! :raised_hands:

Hi @ria

Thanks for the quick reply. I’m using the Custom Auth as Plytix provides the API Key and Password. Would this still be possible?

I think it’s not possible to set it via credentials, as it’s a custom flow. You can create a separate workflow to obtain the token every time you need it. It’s less secure, but still doable

So unfortunately we only have the tokens refresh when using OAuth. It doesn’t look like Plytix provides that? In this case, @barn4k is right and you will have to come up with a separate workflow that gets the token and returns it and refreshes it if it has expired.

It may be easier to just make a new token on each request or if you are self hosting you could make a credential and use that or you might even be able to use the n8n api to update a credential…

I guess there is many ways to solve this. I hope you will find a way that works for you and when you do, please let us know! :slight_smile:

The issue is that n8n API does not have a method to update credentials :sweat_smile:

Good spot that is my fault, For some reason I thought we had an update option. Now I feel like I should add it so that the answer holds up :joy:

2 Likes

Thanks, Everyone!

I’ll implement this and update on the progress.

Hi @Jon ! How close are we to getting the update API call for credentials? Eagerly waiting for it.

This definitely needed, run into this same issue, the creating credentials endpoint creates new credentials each time even if data created with, is the same.

I believe n8n focusses more on unique IDs. This can be seen in all parts like credentials, workflow etc. For every create call a new unique id is created which is further used for delete , update and other calls.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.