monzo-token-renewer

command module
v0.0.0-...-a8ee986 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2022 License: Unlicense Imports: 10 Imported by: 0

README

Monzo API Token Renewer

Simple app that kicks off the Monzo API OAuth dance, gets a token back, and then (allegedly) renews that token. I've not run it long enough to find out if that renewal actually works, but hey, let's find out.

UNLESS YOU ARE ME, READ AND UNDERSTAND THE CODE BEFORE YOU GO NEAR THIS

(This is generally good advice, but for an app that touches your bank account, this is much more important)

Usage

Populate .env file with appropriate values (or set the corresponding env vars)

Run with:

go run .

First thing you'll see is a URL you need to visit to get auth'd. Go to it.

Once auth'd, the redirect should take you to an incredibly thrilling localhost webserver which will tell you something like:

Open the Monzo app to approve, and get some API scopes

You're almost there. Now open the Monzo app, allow access to your data, and you're good.

Every hour (or whatever duration you specified in your env), you'll get logs like these in your terminal:

Response (200): {"authenticated":true,"client_id":"REDACTED","user_id":"REDACTED"}

Response (200): {"balance":69,"total_balance":69,"balance_including_flexible_savings":69,"currency":"GBP","spend_today":69,"local_currency":"","local_exchange_rate":0,"local_spend":[{"spend_today":69,"currency":"USD"},{"spend_today":69,"currency":"GBP"}]}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL