New to the Monzo API and trying to set up a webhook on my server, part of the webhook requires moving money to/from pots, so authentication needs to happen at various stages. So I’ve set up a process to authenticate a user, the Monzo email gets sent successfully, and when the link in the email is clicked, my server can process the authentication code. Now the next step is exchanging the code for an access token, here is where it fails. I create a http request as outlined in the Monzo API docs, with the redirect_uri
being the same as the one that is used for the user authentication step (I have registered this URI as a Redirect URI in the Client settings on the Monzo developer portal). When I send this request, monzo responds with:
{"code":"bad_request.bad_authorization_code.redirect_uri_mismatch","error":"invalid_request","error_description":"Invalid redirect URI","message":"Invalid redirect URI"}
My http request is formatted as follows (using Python and the requests
module):
url = https://api.monzo.com/oauth2/token
form = {
"grant_type": "authorization_code",
"client_id": global_client_id,
"client_secret": global_client_secret,
"redirect_uri": global_redirect_uri,
"code": code
}
requests.post(url, data=form)
Anyone know why monzo won’t accept the redirect_uri? The URI is accepted when given as the redirect uri for the email authentication stage…