getAccessToken static method

Future<AccessToken> getAccessToken(
  1. String apiKey,
  2. String apiSecretKey,
  3. Map<String, String> queries
)

Implementation

static Future<AccessToken> getAccessToken(
  String apiKey,
  String apiSecretKey,
  Map<String, String> queries,
) async {
  final authParams = requestHeader(
    apiKey: apiKey,
    oauthToken: queries['oauth_token'],
    oauthVerifier: queries['oauth_verifier'],
  );
  final params = await httpPost(
    ACCESS_TOKEN_URI,
    authParams,
    apiKey,
    apiSecretKey,
  );
  if (params == null) {
    throw Exception();
  }
  return AccessToken(params);
}