Informations d'un contact
curl --request POST \
--url https://api.wachap.com/v1/whatsapp/contacts/info \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"phone": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', phone: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/contacts/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', phone: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/contacts/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/contacts/info"
payload = {
"accountId": "<string>",
"phone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/contacts/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wachap.com/v1/whatsapp/contacts/info"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Contacts WhatsApp
Informations d’un contact
Récupérez les informations détaillées d’un contact WhatsApp
POST
/
whatsapp
/
contacts
/
info
Informations d'un contact
curl --request POST \
--url https://api.wachap.com/v1/whatsapp/contacts/info \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"phone": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', phone: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/contacts/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', phone: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/contacts/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/contacts/info"
payload = {
"accountId": "<string>",
"phone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/contacts/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>',
'phone' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wachap.com/v1/whatsapp/contacts/info"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"phone\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Endpoint
/v1/whatsapp/contacts/info
Headers
Bearer token avec votre Secret Key (format:
Bearer sk_...)Body Parameters
L’identifiant du compte WhatsApp
Le numéro de téléphone (format: +2290112345678 ou 2290112345678)
Exemples de requêtes
curl -X POST https://api.wachap.com/v1/whatsapp/contacts/info \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"phone": "+2290112345678"
}'
const response = await fetch('https://api.wachap.com/v1/whatsapp/contacts/info', {
method: 'POST',
headers: {
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountId: 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
phone: '+2290112345678'
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.wachap.com/v1/whatsapp/contacts/info"
headers = {
"Authorization": "Bearer token",
"Content-Type": "application/json"
}
payload = {
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"phone": "+2290112345678"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
<?php
$curl = curl_init();
$payload = [
"accountId" => "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"phone" => "+2290112345678"
];
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/contacts/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer token",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Exemple de réponse
{
"success": true,
"message": "Informations récupérées",
"contactInfo": {
"jid": "2290112345678@s.whatsapp.net",
"phoneNumber": "2290112345678",
"name": "John Doe",
"businessName": "John's Business",
"verifiedName": "Official Name",
"status": "Hey there!",
"pictureId": "1234567890",
"devices": ["0"],
"isBusinessAccount": true
}
}
Champs de la réponse
| Champ | Type | Description |
|---|---|---|
jid | string | Identifiant WhatsApp du contact |
phoneNumber | string | Numéro de téléphone sans indicateur |
name | string | Nom enregistré dans le store local |
businessName | string | Nom business du contact (si disponible) |
verifiedName | string | Nom vérifié WhatsApp (comptes business uniquement) |
status | string | Statut WhatsApp du contact |
pictureId | string | ID de la photo de profil |
devices | array | Liste des appareils connectés |
isBusinessAccount | boolean | Indique si c’est un compte business |
Codes d’erreur
| Code | Description |
|---|---|
400 | MISSING_ACCOUNT_ID - accountId manquant |
400 | MISSING_PHONE - phone manquant |
401 | INVALID_SECRET_KEY - Clé secrète invalide |
404 | ACCOUNT_NOT_FOUND - Compte WhatsApp non trouvé |
404 | CONTACT_NOT_FOUND - Contact non trouvé |
⌘I
