Groups
Wappfy API के माध्यम से WhatsApp groups manage करें। आप groups बना सकते हैं, participants manage कर सकते हैं, invite links handle कर सकते हैं, और बहुत कुछ कर सकते हैं।
सभी group endpoints एक specific instance से जुड़े हैं:
/api/instances/{instanceId}/groups/...
एक Group बनाएं
प्रारंभिक participants के साथ एक नया WhatsApp group बनाएं।
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Project Alpha",
"participants": [
"5511999998888@s.whatsapp.net",
"5511888887777@s.whatsapp.net"
]
}'
Response:
{
"data": {
"group_id": "120363012345678901@g.us",
"name": "Project Alpha",
"participants": [
{
"id": "5511999998888@s.whatsapp.net",
"is_admin": false
},
{
"id": "5511888887777@s.whatsapp.net",
"is_admin": false
}
]
}
}
Groups की सूची
Instance जिन सभी groups का member है उन्हें प्राप्त करें।
curl https://api.wappfy.io/api/instances/inst_abc123/groups \
-H "X-Api-Key: YOUR_API_KEY"
Response:
{
"data": [
{
"group_id": "120363012345678901@g.us",
"name": "Project Alpha",
"participant_count": 5
},
{
"group_id": "120363098765432109@g.us",
"name": "Support Team",
"participant_count": 12
}
]
}
Group की जानकारी प्राप्त करें
किसी specific group की विस्तृत जानकारी fetch करें।
curl https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us \
-H "X-Api-Key: YOUR_API_KEY"
Response:
{
"data": {
"group_id": "120363012345678901@g.us",
"name": "Project Alpha",
"description": "Team workspace for Project Alpha",
"owner": "5511999998888@s.whatsapp.net",
"created_at": "2026-01-15T10:00:00Z",
"participants": [
{
"id": "5511999998888@s.whatsapp.net",
"is_admin": true,
"is_super_admin": true
},
{
"id": "5511888887777@s.whatsapp.net",
"is_admin": false,
"is_super_admin": false
}
]
}
}
एक Group Update करें
Group का name या description update करें। यह action करने के लिए आपका group admin होना आवश्यक है।
curl -X PATCH https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Project Alpha v2",
"description": "Updated workspace for Project Alpha"
}'
केवल group admins ही group name और description update कर सकते हैं। यदि instance admin नहीं है, तो यह 403 error लौटाएगा।
एक Group छोड़ें
Instance को group से हटाएं।
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/leave \
-H "X-Api-Key: YOUR_API_KEY"
Group छोड़ने के बाद, आपको वापस जोड़ने के लिए invite link या किसी अन्य admin की आवश्यकता होगी।
Participants
Participants की सूची
किसी group के सभी participants प्राप्त करें।
curl https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/participants \
-H "X-Api-Key: YOUR_API_KEY"
Response:
{
"data": [
{
"id": "5511999998888@s.whatsapp.net",
"is_admin": true,
"is_super_admin": true
},
{
"id": "5511888887777@s.whatsapp.net",
"is_admin": false,
"is_super_admin": false
},
{
"id": "5511777776666@s.whatsapp.net",
"is_admin": true,
"is_super_admin": false
}
]
}
Participants जोड़ें
Group में एक या अधिक participants जोड़ें। आपका group admin होना आवश्यक है।
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/participants \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"participants": [
"5511666665555@s.whatsapp.net",
"5511555554444@s.whatsapp.net"
]
}'
Participants हटाएं
Group से एक या अधिक participants हटाएं। आपका group admin होना आवश्यक है।
curl -X DELETE https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/participants \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"participants": [
"5511666665555@s.whatsapp.net"
]
}'
Invite Codes
Invite Code प्राप्त करें
Group का invite link generate या प्राप्त करें। आपका group admin होना आवश्यक है।
curl https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/invite-code \
-H "X-Api-Key: YOUR_API_KEY"
Response:
{
"data": {
"invite_code": "https://chat.whatsapp.com/AbCdEfGhIjKlMn"
}
}
Invite Code से Join करें
Invite code का उपयोग करके group में शामिल हों।
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/join \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"invite_code": "AbCdEfGhIjKlMn"
}'
केवल code भाग pass करें, पूर्ण URL नहीं। https://chat.whatsapp.com/AbCdEfGhIjKlMn के लिए, AbCdEfGhIjKlMn pass करें।
Groups में Messages भेजना
किसी group में message भेजने के लिए, group की chat ID के साथ standard message भेजें endpoint का उपयोग करें:
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "120363012345678901@g.us",
"type": "text",
"text": "Hello team!"
}'
Group chat IDs हमेशा @g.us से समाप्त होती हैं।
Endpoint Reference
| Method | Endpoint | विवरण |
|---|
POST | /api/instances/{id}/groups | नया group बनाएं |
GET | /api/instances/{id}/groups | सभी groups की सूची |
GET | /api/instances/{id}/groups/{groupId} | Group की जानकारी प्राप्त करें |
PATCH | /api/instances/{id}/groups/{groupId} | Group name/description update करें |
POST | /api/instances/{id}/groups/{groupId}/leave | Group छोड़ें |
GET | /api/instances/{id}/groups/{groupId}/participants | Participants की सूची |
POST | /api/instances/{id}/groups/{groupId}/participants | Participants जोड़ें |
DELETE | /api/instances/{id}/groups/{groupId}/participants | Participants हटाएं |
GET | /api/instances/{id}/groups/{groupId}/invite-code | Invite code प्राप्त करें |
POST | /api/instances/{id}/groups/join | Invite code से join करें |
Error Handling
| Status Code | विवरण |
|---|
403 | आप इस group के admin नहीं हैं। |
404 | Group नहीं मिला या instance member नहीं है। |
409 | Participant पहले से group में है (add पर) या group में नहीं है (remove पर)। |
422 | अमान्य participant format। {phone}@s.whatsapp.net का उपयोग करें। |