whatsapp-business-java-api

: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(TOKEN);

        WhatsappBusinessManagementApi whatsappBusinessManagementApi = factory.newBusinessManagementApi();

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

        System.out.println(response);

Verify a verification code:

        WhatsappApiFactory factory = WhatsappApiFactory.newInstance(TOKEN);

        WhatsappBusinessManagementApi whatsappBusinessManagementApi = factory.newBusinessManagementApi();

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

        System.out.println(response2);

See full examples here

:arrow_heading_up: back