Rechazar participantes
curl --request POST \
--url https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groupId": "120363019502650977-group",
"phones": [
"5544999999999",
"5544888888888"
]
}
'import requests
url = "https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant"
payload = {
"groupId": "120363019502650977-group",
"phones": ["5544999999999", "5544888888888"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groupId: '120363019502650977-group',
phones: ['5544999999999', '5544888888888']
})
};
fetch('https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant', 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}/reject-participant",
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([
'groupId' => '120363019502650977-group',
'phones' => [
'5544999999999',
'5544888888888'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant"
payload := strings.NewReader("{\n \"groupId\": \"120363019502650977-group\",\n \"phones\": [\n \"5544999999999\",\n \"5544888888888\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"groupId\": \"120363019502650977-group\",\n \"phones\": [\n \"5544999999999\",\n \"5544888888888\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"groupId\": \"120363019502650977-group\",\n \"phones\": [\n \"5544999999999\",\n \"5544888888888\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"value": true
}{
"error": "invalid path parameter"
}{
"error": "instance subscription is not active"
}{
"error": "internal server error"
}{
"error": "failed to reach the META_WHATSAPP channel"
}{
"error": "<string>"
}Participantes y admins
Rechazar participantes
Rechaza la entrada de participantes al grupo
POST
/
reject-participant
Rechazar participantes
curl --request POST \
--url https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"groupId": "120363019502650977-group",
"phones": [
"5544999999999",
"5544888888888"
]
}
'import requests
url = "https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant"
payload = {
"groupId": "120363019502650977-group",
"phones": ["5544999999999", "5544888888888"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
groupId: '120363019502650977-group',
phones: ['5544999999999', '5544888888888']
})
};
fetch('https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant', 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}/reject-participant",
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([
'groupId' => '120363019502650977-group',
'phones' => [
'5544999999999',
'5544888888888'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant"
payload := strings.NewReader("{\n \"groupId\": \"120363019502650977-group\",\n \"phones\": [\n \"5544999999999\",\n \"5544888888888\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"groupId\": \"120363019502650977-group\",\n \"phones\": [\n \"5544999999999\",\n \"5544888888888\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://zapi.omni.z-api.io/channels/{channel_id}/token/{channel_token}/reject-participant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"groupId\": \"120363019502650977-group\",\n \"phones\": [\n \"5544999999999\",\n \"5544888888888\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"value": true
}{
"error": "invalid path parameter"
}{
"error": "instance subscription is not active"
}{
"error": "internal server error"
}{
"error": "failed to reach the META_WHATSAPP channel"
}{
"error": "<string>"
}Conceptos
Método que rechaza la entrada de participantes al grupo.En WhatsApp Oficial, esta ruta solo sirve para un grupo con aprobación de entrada, creado con
requireAdminApproval true en Crear grupo.Autorizaciones
Cuerpo
application/json