getEmailAddress method

Future<GetEmailAddressResponse> getEmailAddress()

The function is used to initialize a session and set the client with an email address. If the session already exists, then it will return the email address details of the existing session. If a new session needs to be created, then it will create new email address randomly. The function will return a number of arguments for the client to remember, including the ‘sid_token’. The ‘sid_token’ is passed to each subsequent API call to maintain state.

Implementation

Future<GetEmailAddressResponse> getEmailAddress() async {
  final response =
      await _doRequest(call: 'get_email_address', queryParameters: {});
  return GetEmailAddressResponse.fromJson(jsonDecode(response.body));
}