Check if a phone number is on WhatsApp
caution
Sadly this endpoint was deprecated by WhatsApp in November last year, so it's also deprecated by Hilos.
Before sending the first message to a contact, you might want to check if the contact’s phone number is indeed on WhatsApp. To do so, Hilos has an endpoint you can use to test this:
HTTP GET https://api.hilos.io/api/contact/whatsapp-check?phone=+521122334455
If that phone number has a WhatsApp account, you’ll get a response like the following:
{
"wa_status": "valid", // One of "valid", "invalid", "failed", "unchecked"
"wa_id": "5211122334455"
}
- If the returned
wa_status
isinvalid
, it means that messages sent to that phone number will fail with the error messageContact is not on WhatsApp.
- If the returned
wa_status
isfailed
, it means that WhatsApp did not return a valid response to our query. You may try again at a later time. - If there’s a network error between Hilos and WhatsApp while querying, we’ll return a
HTTP 503
with the following body:
{
"message": "Could not check for contact with WA API"
}