Agung
Agung

Reputation: 13803

how to check if a phone number is valid whatsapp number in Android?

so I have an edit text that will be used as a view to get phone number from user, say if the phone number is +6123456789 , I want to check if this number has whatsapp number or not,i want to avoid the user to input fake whatsapp number, how to do that ?

Upvotes: 6

Views: 38387

Answers (3)

morteza khadem
morteza khadem

Reputation: 514

You can send a message to the phone number that you want to check, and if you get the 131026 error code in Webhook, it means your phone number is invalid.

Whatsapp error codes:

https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes/

Upvotes: 2

Ronak Sethi
Ronak Sethi

Reputation: 627

Update (Nov 2022):

Whatsapp are repurposing the contacts node starting in v2.43 to no longer provide status information about a phone number. Regardless of whether a user has WhatsApp, it will always return valid for status in the response. For more information see official docs

original answer:

You must have: Facebook Whatsapp Business Api for contacts check

Once you have a valid business account you could then query the Contact. You will get all the details in the documentation.

Hope it works for you!

Upvotes: 7

Emanovwe Emmanuel J
Emanovwe Emmanuel J

Reputation: 49

You can try this service https://watverifyapi.live
It allows you to verify multiple whatsapp number at a time.

Upvotes: 0

Related Questions