send OTP - ReconoSERID/SDK-ReconoSERID-Android GitHub Wiki

**Send OTP **

Method that requests the server to send an OTP, for the validation of an email or mobile number. an email or mobile number.

#!java

public void enviarOTP(@NotNull String guidCiudadano, @NotNull DatosOTP datosOTP, @NotNull CallbackSendOTP listener)

Receive

Parameters ## Parameter

Parameter Type Required Description
guidCitizen String SI It is the unique identifier of the citizen.
dataOTP Object SI An object containing the OTP data.
CallbackSendOTP Callback SI SI

DataOTP |

Parameter Type Required Description
typeOTP String YES Is the identifier can be "MAIL" or "SMS".
message String YES Message to be sent to the user

Receives SendOTP which is a TransactionResponse.

Example:

#!java

DatosOTP datosOTP = new DatosOTP("SMS", "mensaje");
        ServicesOlimpia.getInstance().enviarOTP(guidCiudadano, datosOTP , new OlimpiaInterface.CallbackSendOTP() {
            @Override
            public void onSuccess(EnviarOTP sendOTP) {
               //
            }

            @Override
            public void onError(RespuestaTransaccion transactionResponse) {
                //
            }
        });

Back to services