Buscar grupos
curl --request GET \
--url https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups \
--header 'Authorization: Bearer <token>'import requests
url = "https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups', 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://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"isGroup": true,
"name": "Grupo teste",
"phone": "120263358412332916-group",
"unread": "0",
"lastMessageTime": "1730918668000",
"isMuted": "0",
"isMarkedSpam": "false",
"archived": "false",
"pinned": "false",
"muteEndTime": null,
"messagesUnread": "0"
}
]{
"error": "invalid path parameter"
}{
"error": "instance subscription is not active"
}{
"error": "internal server error"
}{
"error": "failed to reach the META_WHATSAPP channel"
}{
"error": "<string>"
}Consultar
Buscar grupos
Retorna os grupos do canal, com paginação
GET
/
groups
Buscar grupos
curl --request GET \
--url https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups \
--header 'Authorization: Bearer <token>'import requests
url = "https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups', 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://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/groups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"isGroup": true,
"name": "Grupo teste",
"phone": "120263358412332916-group",
"unread": "0",
"lastMessageTime": "1730918668000",
"isMuted": "0",
"isMarkedSpam": "false",
"archived": "false",
"pinned": "false",
"muteEndTime": null,
"messagesUnread": "0"
}
]{
"error": "invalid path parameter"
}{
"error": "instance subscription is not active"
}{
"error": "internal server error"
}{
"error": "failed to reach the META_WHATSAPP channel"
}{
"error": "<string>"
}Conceituação
Método que retorna os grupos do canal. Use o campophone de cada item como ID do grupo nas demais rotas desta seção.
Informe page e pageSize para paginar o resultado.
No WhatsApp Oficial, a lista traz os grupos ativos do número na Groups API da Meta, e
page e pageSize são opcionais (valem 1 e 10).Autorizações
Parâmetros de consulta
Resposta
Sucesso.