Skip to content

Latest commit

 

History

History
57 lines (34 loc) · 2.16 KB

phone_numbers.md

File metadata and controls

57 lines (34 loc) · 2.16 KB

📜 Managing phone numbers

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

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

var phoneNumbers = whatsappBusinessManagementApi.retrievePhoneNumbers(TestConstants.WABA_ID);

ObjectMapper mapper = new ObjectMapper();

System.out.println(mapper.writeValueAsString(phoneNumbers));

WhatsappApiFactory factory = WhatsappApiFactory.newInstance();

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

var phoneNumber = whatsappBusinessManagementApi.retrievePhoneNumber(TestConstants.PHONE_NUMBER_ID);

ObjectMapper mapper = new ObjectMapper();

System.out.println(mapper.writeValueAsString(phoneNumber));

WhatsappApiFactory factory = WhatsappApiFactory.newInstance();

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

var phoneNumber = whatsappBusinessManagementApi.retrievePhoneNumber(TestConstants.PHONE_NUMBER_ID, "name_status", "verified_name");

ObjectMapper mapper = new ObjectMapper();

System.out.println(mapper.writeValueAsString(phoneNumber));

See full examples here

⤴️ back