Hi Team,
While Fetching the data from accounts we are getting the below errors. Please find the below details. Here I am passing the new token. So can you please suggest this?
URL https://api.monzo.com/accounts
Header: Authorization :Bearer eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJlYiI6IkZuaWlUWlhneVFCNkkydm9RVmRRIiwianRpIjoiYWNjdG9rXzAwMDBBNUt4dGhHelZ5aTkzeFBvNXgiLCJ0eXAiOiJhdCIsInYiOiI2In0.I_URO6GrU6ZhmDTM8aXpHuQvGGG8ayZX6UvuDVyM2NqPZnALirBu0drHq66OHjE-1hdl5Dt7_1v9d0dRONfuZw
Have you used the oauth flow to get your access token or taken the one from the playground(after using the oauth flow) ? Have you approved the access in the app?
http --form POST "https://api.monzo.com/oauth2/token" \
"grant_type=authorization_code" \
"client_id=$client_id" \
"client_secret=$client_secret" \
"redirect_uri=$redirect_uri" \
"code=$authorization_code"
{
"access_token": "access_token",
"client_id": "client_id",
"expires_in": 21600,
"refresh_token": "refresh_token",
"token_type": "Bearer",
"user_id": "user_id"
} so from thi url i get the responce like token and everything.
and i after i try this
http --form POST "https://api.monzo.com/oauth2/token" \
"grant_type=refresh_token" \
"client_id=$client_id" \
"client_secret=$client_secret" \
"refresh_token=$refresh_token"
{
"access_token": "access_token_2",
"client_id": "client_id",
"expires_in": 21600,
"refresh_token": "refresh_token_2",
"token_type": "Bearer",
"user_id": "user_id"
} from this url i got every thing.
but when i try to fetch the accounts data from the below url
"https://api.monzo.com/accounts" \
"Authorization: Bearer $access_token"
here i am passed the token where i can get the from this url : "https://api.monzo.com/oauth2/token"
but i am facing issue :{
"error_description": "grant_type is required",
"error": "invalid_request"
}.
so this is the flow I followed. so can you please suggest where I did wrong. please share your info like text and screenshot format.
Which access token are you using? The one from the first response or the second?
That said the 2 nd call you are making is to refresh the token. No need to do that immediately, only do that when the access token has expired from the first call