BASH
curl -X POST "https://api.wachap.com/v1/whatsapp/groups/members/list" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{ "accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878", "groupJid": "120363123456789012@g.us" }'const res = await fetch("https://api.wachap.com/v1/whatsapp/groups/members/list", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
body: JSON.stringify({
accountId: "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
groupJid: "120363123456789012@g.us"
})
});
const data = await res.json();
console.log(data);const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', groupJid: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/groups/members/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/groups/members/list"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer token"
}
data = {
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"groupJid": "120363123456789012@g.us"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())<?php
$url = 'https://api.wachap.com/v1/whatsapp/groups/members/list';
$data = [
'accountId' => 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
'groupJid' => '120363123456789012@g.us'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer token'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.wachap.com/v1/whatsapp/groups/members/list"
data := map[string]string{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"groupJid": "120363123456789012@g.us",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer token")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println(resp.Status)
}{
"success": true,
"message": "<string>",
"groupJid": "<string>",
"total": 123,
"members": [
{
"jid": "<string>",
"phoneNumber": "<string>",
"name": "<string>",
"isAdmin": true,
"isSuperAdmin": true
}
]
}Groupes WhatsApp
Lister les membres
Récupérez la liste des membres d’un groupe WhatsApp.
POST
/
whatsapp
/
groups
/
members
/
list
BASH
curl -X POST "https://api.wachap.com/v1/whatsapp/groups/members/list" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{ "accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878", "groupJid": "120363123456789012@g.us" }'const res = await fetch("https://api.wachap.com/v1/whatsapp/groups/members/list", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
body: JSON.stringify({
accountId: "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
groupJid: "120363123456789012@g.us"
})
});
const data = await res.json();
console.log(data);const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', groupJid: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/groups/members/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/groups/members/list"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer token"
}
data = {
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"groupJid": "120363123456789012@g.us"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())<?php
$url = 'https://api.wachap.com/v1/whatsapp/groups/members/list';
$data = [
'accountId' => 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
'groupJid' => '120363123456789012@g.us'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer token'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.wachap.com/v1/whatsapp/groups/members/list"
data := map[string]string{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"groupJid": "120363123456789012@g.us",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer token")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println(resp.Status)
}{
"success": true,
"message": "<string>",
"groupJid": "<string>",
"total": 123,
"members": [
{
"jid": "<string>",
"phoneNumber": "<string>",
"name": "<string>",
"isAdmin": true,
"isSuperAdmin": true
}
]
}Endpoints
Option 1: GroupJid dans le body
POST https://api.wachap.com/v1/whatsapp/groups/members/list
Option 2: GroupJid dans l’URL (rétrocompatibilité)
POST https://api.wachap.com/v1/whatsapp/groups/:groupJid/members/list
Headers
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| Authorization | string | Oui | Bearer token avec votre Secret Key (format: Bearer sk_...) |
Body Parameters (Option 1)
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| accountId | string | Oui | L’identifiant du compte WhatsApp |
| groupJid | string | Oui | L’identifiant du groupe (format: 120363123456789012@g.us) |
Body Parameters (Option 2)
| Paramètre | Type | Requis | Description |
|---|---|---|---|
| accountId | string | Oui | L’identifiant du compte WhatsApp |
Exemples de requêtes
Option 1: GroupJid dans le body
curl -X POST https://api.wachap.com/v1/whatsapp/groups/members/list \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"groupJid": "120363123456789012@g.us"
}'
Option 2: GroupJid dans l’URL
curl -X POST https://api.wachap.com/v1/whatsapp/groups/120363123456789012@g.us/members/list \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878"
}'
Exemple de réponse
{
"success": true,
"message": "Membres récupérés avec succès",
"groupJid": "120363123456789012@g.us",
"total": 15,
"members": [
{
"jid": "2290112345678@s.whatsapp.net",
"phoneNumber": "2290112345678",
"name": "John Doe",
"isAdmin": true,
"isSuperAdmin": true
},
{
"jid": "33612345678@s.whatsapp.net",
"phoneNumber": "33612345678",
"name": "Marie Dupont",
"isAdmin": false,
"isSuperAdmin": false
}
]
}
Codes d’erreur
| Code | Description |
|---|---|
| 400 | MISSING_ACCOUNT_ID - accountId manquant |
| 400 | MISSING_GROUP_JID - groupJid manquant |
| 401 | INVALID_SECRET_KEY - Clé secrète invalide |
| 404 | ACCOUNT_NOT_FOUND - Compte WhatsApp non trouvé |
| 404 | GROUP_NOT_FOUND - Groupe non trouvé |
Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
application/json
L'identifiant du compte WhatsApp
L'identifiant du groupe (format: 120363123456789012@g.us)
⌘I
