Skip to content

Contacts ​

Check if a number is on WhatsApp ​

ruby
result = client.on_whatsapp?("+33612345678")
# => { exists: true, jid: "[email protected]" }

Returns nil if the number is not registered on WhatsApp.

Profile picture ​

ruby
# Standard resolution
url = client.profile_picture("+33612345678")

# High resolution
url = client.profile_picture("+33612345678", high_res: true)

Returns the URL of the contact's profile picture, or nil if unavailable (privacy settings).

Fetch status (about) ​

ruby
status = client.fetch_status("+33612345678")
# => { status: "Hey there! I am using WhatsApp", set_at: 1234567890 }

Business profile ​

ruby
profile = client.business_profile("+33612345678")
# => { description: "...", category: "...", website: "...", email: "...", ... }

Returns business profile information for WhatsApp Business accounts. Returns nil for regular accounts.

Contact updates ​

Listen for real-time contact updates (profile picture changes, status changes, etc.):

ruby
client.on_contacts_update do |data|
  puts data  # contact update payload from Baileys
end

Rails usage ​

In account mode, all contact methods are available through the proxy:

ruby
hotel.whatsapp.on_whatsapp?("+33612345678")
hotel.whatsapp.profile_picture("+33612345678", high_res: true)

MIT License