Cant get first past stage of authenticating API - access token

Hello,

I’m building a personal app and trying to set up authentication although can’t seem to get past the first stage. Here are the steps I have done:

  • Built an OAuth client in Monzo for Developers
  • Set it to Confidential

I have the client_id and client_secret although can’t seem to get to the point where I authenticate in my app. I’m using Python and have a url which looks like this:

https://auth.monzo.com/?client_id={client_id}&redirect_uri={redirect_uri}&response_type=code&state={random_string}

I have tried:

  • Pasting this into a browser and then trying to get it to email me a link. It gives me a network error after putting in my email address
  • Pinging this with a get request which gives me a 200 although then nothing happens

If I don’t have a web page to redirect this too, what should I use for the redirect URI? I currently have https://developers.monzo.com as the redirect_uri

What do I do with this URL?

I feel like I’m missing something really basic here. Cheers!

EDIT: Figured this one out. Had to:

  • Create the url as outlined in the Redirect to Monzo section (redirect URI has to be a legit web url. I used https://developers.monzo.com)
  • Redirect URL has to be percent encoded i.e. URL safe (mine wasn’t which is why it was failing, I believe)
  • Open that in a web page
  • This should then give you the option to authenticate via email and the app
  • If successful, you’ll get redirected to your web page where the URL in the address box contains your code

You can then exchange your code for a bearer token.

When you say you are creating a personal app, do you mean mobile based or desktop? If mobile (and I am no expert) you can usually register a URL that will call back to your application, you could then parse the URL that was used to access the app and construct the response as required.

If you know Python or PHP, personally I would create a workflow that works using this so you can at least see the process from end to end then move onto the language that your app is going to be written in.

Hello, thank you for replying. When I say personal app, not even an interface. At the moment, all I want to be able to do is call a block of code which:

  • Authenticates
  • Gets the balance of my current account
  • If my current account is below a certain level, top it up

That’s it. Struggling to get past the authentication stage to obtain a token though.

What is it you are building your app in?

Hello Pete, thanks for your message. Manage to sort it out in the end and put the steps I did to fix it in the top post. Cheers for helping anyway!