getUserIdentity function

Future<UserIdentity> getUserIdentity (String accessToken)

Implements the /api/users.identity call

Implementation

Future<UserIdentity> getUserIdentity(String accessToken) async {
  String endpoint = "https://slack.com/api/users.identity?token=$accessToken";
  final http.Response response = await http.get(endpoint);

  return new UserIdentity.fromMap(json.decode(response.body));
}