English
Get Group Members
GET/group/memberList the members of a WhatsApp group, including their names and numbers (unless they're hidden).
Endpoint Details
- Base URL:
https://api-zawa.azickri.com - Headers:
idandsession-id - Requires: a connected session (
isConnected: true)
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | header | string | Yes | The id from Create Session. |
session-id | header | string | Yes | The sessionId from Create Session. |
groupId | query | string | Yes | Group ID, e.g. [email protected]. |
Example Request
bash
curl "https://api-zawa.azickri.com/group/[email protected]" \
-H "id: YOUR_ID" \
-H "session-id: YOUR_SESSION_ID"javascript
import axios from 'axios';
const response = await axios.get('https://api-zawa.azickri.com/group/member', {
params: {
groupId: '[email protected]',
},
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
},
});
console.log(response.data);javascript
const params = new URLSearchParams({
groupId: '[email protected]',
});
const response = await fetch(`https://api-zawa.azickri.com/group/member?${params}`, {
headers: {
'id': 'YOUR_ID',
'session-id': 'YOUR_SESSION_ID',
},
});
const data = await response.json();
console.log(data);Response
json
{
"docs": [
{
"id": "[email protected]",
"name": "Azickri",
"phone": "6281234567890"
},
{
"id": "123456789012345@lid",
"name": "",
"phone": ""
}
]
}json
// groupId is missing
{
"statusCode": 400,
"message": "groupId should not be empty\ngroupId must be a string"
}
// Missing headers
{
"statusCode": 400,
"message": "invalid header"
}json
{
"statusCode": 404,
"message": "session not found"
}json
{
"statusCode": 500,
"message": "session not connected"
}| Field | Type | Description |
|---|---|---|
docs | array | The list of group members. |
docs[].id | string | The member's WhatsApp ID. Ends in either @s.whatsapp.net or @lid. |
docs[].name | string | The member's name from your address book. Falls back to their number. |
docs[].phone | string | The member's number in international format. May be empty. |
Why are some numbers empty?
WhatsApp can now hide group members' numbers behind an anonymous ID ending in @lid. If the number isn't in your address book either, phone (and name) will be empty. That's WhatsApp's rule, not a Zawa bug. 🙏