Hi, I'm having problems exchanging the access code for the token.
I'm in Android Studio in Java.
First I load this URL into my Web View :
String authUrl = "https://www.strava.com/oauth/authorize?" +
"client_id=" + clientId +
"&redirect_uri=" + redirectUri +
"&response_type=code" +
"&scope=activity:read_all";
I get the authorization code.
But then when I load the token exchange URL :
String authUrl = "https://www.strava.com/api/v3/oauth/token?" +
"client_id=" + clientId +
"&client_secret=" + clientSecret +
"&code=" + code +
"&grant_type=" + "authorization_code";
I get this type of message :
{"message":"Record Not Found","errors":[{"resource":"resource","field":"path","code":"invalid"}]}
I don't understand why I get it, I've tried different ways but the documentation seems to be outdated?
In the getting started page they say to do : https://developers.strava.com/docs/getting-started/
curl -X POST https://www.strava.com/oauth/token
-F client_id=YOURCLIENTID
-F client_secret=YOURCLIENTSECRET
-F code=AUTHORIZATIONCODE
-F grant_type=authorization_code
And this : https://developers.strava.com/docs/authentication/
client_id required integer, in query | The application’s ID, obtained during registration. |
client_secret required string, in query | The application’s secret, obtained during registration. |
code required string, in query | The code parameter obtained in the redirect. |
grant_type required string, in query | The grant type for the request. For initial authentication, must always be "authorization_code". |
What am I missing ?
Thanks!