whatsapp-business-java-sdk

:scroll: Get verification codes and verify then

You can:

You need to verify the phone number you want to use to send messages to your customers. Phone numbers must be verified through SMS/voice call. The verification process can be done through this library.

See the examples:

Get a verification code:

WhatsappApiFactory factory = WhatsappApiFactory.newInstance();

WhatsappBusinessManagementApi whatsappBusinessManagementApi = factory.newBusinessManagementApi(TestConstants.TOKEN);

var response = whatsappBusinessManagementApi.requestCode(TestConstants.PHONE_NUMBER_ID, new RequestCode(CodeMethodType.SMS, LanguageType.EN_US));

System.out.println(response);

Verify a verification code:

WhatsappApiFactory factory = WhatsappApiFactory.newInstance();

WhatsappBusinessManagementApi whatsappBusinessManagementApi = factory.newBusinessManagementApi(TestConstants.TOKEN);

var response2 = whatsappBusinessManagementApi.verifyCode(TestConstants.PHONE_NUMBER_ID, new VerifyCode("0000"));

System.out.println(response2);

See full examples here

:arrow_heading_up: back