You can:
- Retrieve phone numbers data from a Whatsapp Business Account;
- Retrieve a specific phone number data by id.
See the examples:
WhatsappApiFactory factory = WhatsappApiFactory.newInstance(TOKEN);
WhatsappBusinessManagementApi whatsappBusinessManagementApi = factory.newBusinessManagementApi();
var phoneNumbers = whatsappBusinessManagementApi.retrievePhoneNumbers(WABA_ID);
ObjectMapper mapper = new ObjectMapper();
System.out.println(mapper.writeValueAsString(phoneNumbers));
WhatsappApiFactory factory = WhatsappApiFactory.newInstance(TOKEN);
WhatsappBusinessManagementApi whatsappBusinessManagementApi = factory.newBusinessManagementApi();
var phoneNumber = whatsappBusinessManagementApi.retrievePhoneNumber(PHONE_NUMBER_ID);
ObjectMapper mapper = new ObjectMapper();
System.out.println(mapper.writeValueAsString(phoneNumber));
WhatsappApiFactory factory = WhatsappApiFactory.newInstance(TOKEN);
WhatsappBusinessManagementApi whatsappBusinessManagementApi = factory.newBusinessManagementApi();
var phoneNumber = whatsappBusinessManagementApi.retrievePhoneNumber(PHONE_NUMBER_ID, "name_status", "verified_name");
ObjectMapper mapper = new ObjectMapper();
System.out.println(mapper.writeValueAsString(phoneNumber));
See full examples here