Skip to content

CheckWhatsapp#

Test

השיטה בודקת את זמינות חשבון WhatsApp במספר טלפון.

בַּקָשָׁה#

כדי לבדוק את זמינות חשבון WhatsApp, עליך לבצע את הבקשה בכתובת:

POST
{{apiUrl}}/waInstance{{idInstance}}/checkWhatsapp/{{apiTokenInstance}}
TEST

For apiUrl, idInstance and apiTokenInstance request parameters, refer to Before you start section.

בקש פרמטרים#

פָּרָמֶטֶר סוּג הֶכְרֵחִי תֵאוּר
phoneNumber integer Yes Recipient's phone number in international format: 11 or 12 digits; Example: 11001234567 or 380123456789

Request body example#

{
    "phoneNumber": 11001234567
}

תְשׁוּבָה#

תגובת פרמטר#

פָּרָמֶטֶר סוּג תֵאוּר
existsWhatsapp boolean דגל זמינות WhatsApp על מספר טלפון

דוגמה תגובה#

{
    "existsWhatsapp": true
}

CheckWhatsapp שגיאות#

לרשימה של שגיאות משותפות לכל השיטות, עיין ב שגיאות נפוצות סָעִיף

HTTP קוד מזהה שגיאה תֵאוּר
400 bad phone number, valid 11 or 12 digits פורמט לא חוקי של מספר טלפון, חייב להיות בן 11 או 12 ספרות
400 check phone number timeout limit exceeded חרג מהזמן הקצוב לתגובה לבדיקת מספר טלפון
400 instance is starting or not authorized המופע מתחיל או אינו מורשה

בקש דוגמאות{#request-example}#

import requests
import json

url = "{{apiUrl}}/waInstance{{idInstance}}/checkWhatsapp/{{apiTokenInstance}}"

payload = json.dumps({ "phoneNumber": 441234567890 })
headers = {
  'Content-Type': 'application/json'
}

response = requests.post(url, json=payload)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/checkWhatsapp/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data '{
    "phoneNumber": 441234567890
}'
var restTemplate = new RestTemplate();
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/checkWhatsapp/")
    .append({{apiTokenInstance}});

var headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);

var jsonBody = "{\"phoneNumber\": 441234567890}";

var requestEntity = new HttpEntity<>(jsonBody, headers);

var response = restTemplate.exchange(requestUrl.toString(), HttpMethod.POST, requestEntity, String.class);
System.out.println(response);
var requestUrl = new StringBuilder();
requestUrl
    .append({{apiUrl}})
    .append("/waInstance").append({{idInstance}})
    .append("/checkWhatsapp/")
    .append({{apiTokenInstance}});

var response = Unirest.post(requestUrl.toString())
    .header("Content-Type", "application/json")
    .body("{\"phoneNumber\": 441234567890}")
    .asString();

System.out.println(response);
Sub CheckWhatsapp()
    Dim url As String
    Dim RequestBody As String
    Dim http As Object
    Dim response As String

    ' The apiUrl, idInstance and apiTokenInstance values are available in console, double brackets must be removed
    url = "{{apiUrl}}/waInstance{{idInstance}}/CheckWhatsapp/{{apiTokenInstance}}"

    ' chatId - is the number to check whatsapp
    RequestBody = "{""phoneNumber"":""71234567890""}"

    Set http = CreateObject("MSXML2.XMLHTTP")

    With http
        .Open "POST", url, False
        .setRequestHeader "Content-Type", "application/json"
        .Send RequestBody
    End With

    response = http.responseText

    Debug.Print response

    ' Outputting the answer to the desired cell
    Range("A1").Value = response

    Set http = Nothing
End Sub