Entrar no grupo via código
curl --request POST \
--url https://{host}/api/{session}/groups/join \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"code": "https://chat.whatsapp.com/1234567890abcdef"
}
'import requests
url = "https://{host}/api/{session}/groups/join"
payload = { "code": "https://chat.whatsapp.com/1234567890abcdef" }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'https://chat.whatsapp.com/1234567890abcdef'})
};
fetch('https://{host}/api/{session}/groups/join', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/groups/join",
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([
'code' => 'https://chat.whatsapp.com/1234567890abcdef'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/{session}/groups/join"
payload := strings.NewReader("{\n \"code\": \"https://chat.whatsapp.com/1234567890abcdef\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/groups/join")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"https://chat.whatsapp.com/1234567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/groups/join")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"https://chat.whatsapp.com/1234567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"groupId": "120363XXXXX@g.us",
"message": "Você ingressou no grupo com sucesso"
}
Grupos
Ingressar no Grupo via Código
Ingressar em um grupo usando código de convite
POST
/
api
/
{session}
/
groups
/
join
Entrar no grupo via código
curl --request POST \
--url https://{host}/api/{session}/groups/join \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"code": "https://chat.whatsapp.com/1234567890abcdef"
}
'import requests
url = "https://{host}/api/{session}/groups/join"
payload = { "code": "https://chat.whatsapp.com/1234567890abcdef" }
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'https://chat.whatsapp.com/1234567890abcdef'})
};
fetch('https://{host}/api/{session}/groups/join', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/groups/join",
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([
'code' => 'https://chat.whatsapp.com/1234567890abcdef'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$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://{host}/api/{session}/groups/join"
payload := strings.NewReader("{\n \"code\": \"https://chat.whatsapp.com/1234567890abcdef\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/groups/join")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"https://chat.whatsapp.com/1234567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/groups/join")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"https://chat.whatsapp.com/1234567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"groupId": "120363XXXXX@g.us",
"message": "Você ingressou no grupo com sucesso"
}
Descrição
Este endpoint permite ingressar em um grupo usando um código de convite.Parâmetros de URL
ID único da sessão WhatsApp
Body
{
"code": "valor"
}
Parâmetros do Body
| Propriedade | Tipo | Obrigatório | Descrição |
|---|---|---|---|
code | string | ✅ Sim | Código de convite do grupo |
Resposta
{
"success": true,
"groupId": "120363XXXXX@g.us",
"message": "Você ingressou no grupo com sucesso"
}
Códigos de Status
200- Ingresso realizado com sucesso400- Código inválido401- Não autorizado404- Grupo não encontrado
Exemplo de Uso
curl -X POST https://api.wappfy.com.br/api/my-session/groups/join \
-H "Content-Type: application/json" \
-d '{
"code": "Abc123Xyz456"
}'
const session = 'my-session';
const response = await fetch(`https://api.wappfy.com.br/api/${session}/groups/join`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
code: 'Abc123Xyz456'
})
});
const data = await response.json();
console.log(data);
import requests
session = 'my-session'
response = requests.post(
f'https://api.wappfy.com.br/api/{session}/groups/join',
json={'code': 'Abc123Xyz456'}
)
data = response.json()
print(data)
Authorizations
Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)
Path Parameters
Nome da sessão (instanceName)
Body
application/json
Código do grupo (123) ou url (https://chat.whatsapp.com/123) (Group code (123) or url (https://chat.whatsapp.com/123))
Example:
"https://chat.whatsapp.com/1234567890abcdef"
Response
200 - application/json
ID do Grupo
Example:
"123@g.us"
⌘I
