Authentication for once off scripts

I’ve found the need now more than once to write a once-off scripts to either retrieve or push some data to my freeageent account. I’m now writing a script that would run on a cron job to do various daily checks and tasks for me.

My problem is that the FA api uses OAuth2, which requires a redirect_url. Since these are simple, local scripts, there is no webserver behind them. Thus far I’ve used the google oauth playground to for this purpose, but this becomes a nuisance when the keys expire and you have to go through that entire process again.

Are there any other authentication methods available for these kind of scripts?

Hi Andre,

Did you check the rest of the forum? The post below yours gives the correct answer…

I also run a number of reports from FreeAgent every night using the API. I just give the scripts the refresh token and get the scripts to refresh and get a new access token whenever they need it :slight_smile:

I hope this helps.

Yes, I eventually did see the one post that mentions that the refresh token never changes. So I just fetched the initial refresh token via the oauth playground. All is find and dandy now :slight_smile: