Skip to content

Commit

Permalink
Merge pull request #7 from sinch/versioned-verification-domain
Browse files Browse the repository at this point in the history
refactor: Use versioned domain for verification
  • Loading branch information
JPPortier authored Jun 28, 2024
2 parents c60847f + e60e9b8 commit 738b699
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions snippets/verification/start_sms/Snippet.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package verification;

import com.sinch.sdk.domains.verification.*;
import com.sinch.sdk.domains.verification.models.*;
import com.sinch.sdk.domains.verification.models.requests.*;
import com.sinch.sdk.domains.verification.models.response.*;
import com.sinch.sdk.domains.verification.api.v1.VerificationService;
import com.sinch.sdk.domains.verification.api.v1.VerificationStartService;
import com.sinch.sdk.domains.verification.models.v1.NumberIdentity;
import com.sinch.sdk.domains.verification.models.v1.start.request.VerificationStartRequestSms;
import com.sinch.sdk.domains.verification.models.v1.start.response.VerificationStartResponseSms;
import java.util.logging.Logger;

public class Snippet {
Expand All @@ -14,15 +15,15 @@ static void execute(VerificationService verificationService) {

// REMINDER: verification Service require to have set application key/secret
// onto Sinch Client init
VerificationsService verificationsService = verificationService.verifications();
VerificationStartService startService = verificationService.verificationStart();

String phoneNumber = "YOUR_phone_number";

LOGGER.info(String.format("Sending a SMS verification to '%s'", phoneNumber));

StartVerificationResponseSMS response =
verificationsService.startSms(
StartVerificationSMSRequestParameters.builder()
VerificationStartResponseSms response =
startService.startSms(
VerificationStartRequestSms.builder()
.setIdentity(NumberIdentity.valueOf(phoneNumber))
.build());

Expand Down

0 comments on commit 738b699

Please sign in to comment.