callTokenApi method

dynamic callTokenApi(
  1. dynamic code,
  2. dynamic clientId,
  3. dynamic clientSecret,
  4. dynamic redirectUri
)

Implementation

callTokenApi(code,clientId,clientSecret,redirectUri) async {
  var params = {
    "grant_type":"authorization_code",
    "code":code,
    "client_id":clientId,
    "client_secret":clientSecret,
    "redirect_uri":redirectUri
  };
  var result = await CallApi("POST",params,"https://www.linkedin.com/oauth/v2/accessToken");
  return result["access_token"];
}