So basically im trying to relyably get my monzo balance with tasker which I can successfully do using HTTPGET to get the balance. However to get this to work im having to get tasker to open the monzo api playground webpage and copy the accesstoken from there to then use further down my tasks. This of course expires after a while and so if the HTTP Get request fails it will get as new code again.
I don’t like how this is being achieved as it has to actually unlock my device to do this (obviously not great for security)
So I am trying to get a new fresh token through tasker to replace the sloppy way I’m doing it now.
I can receive a refresh token through HTTPie as stated in the Api Docs but I just can’t get it to work within tasker for some reason.
I think trying to do this directly from your phone is gonna be tough If I’m reading right, you want to have your phone authenticate with our API so you can pull your balance.
Once you’ve authenticated (which I think you’ve done?) you need to use the grant_type of refresh_tokenas documented here.
That said, though, I think using your phone as the “server” will be rather challenging, as you’ll have to do it all through Tasker. If it was me, I’d get a cheapo Raspberry Pi Zero W for £10, have that be your server that handles all your auth, and exposes a JSON endpoint over your local network. Then your phone can call your Pi server, rather than interacting with the API directly.
Not sure if that helps or not, but just some ideas Good luck with it - and welcome to the forum!
I think it can be done through my phone it’s literally just getting the info I can send through httpie to be sent through taskers http request instead. I can save any info I receive into variables and once I get a refresh token into a variable everything will work, pull balance>access token expired error>run task that recieves new refresh token>use new token to pull balance again without error.