sendSecurityCode method
- SendSecurityCodeRequest request
Sends an OTP / security code via GET /challenge.
Implementation
Future<SendSecurityCodeResponse> sendSecurityCode(
SendSecurityCodeRequest request,
) async {
if (request.to.isEmpty) {
throw AfroMessageException('to is required.');
}
final params = request.toQueryParameters(
defaultFrom: config.identifierId,
defaultSender: config.senderName,
);
final json = await _getJson('/challenge', params);
return SendSecurityCodeResponse.fromJson(json);
}