Gestionar grupos en una comunidad
curl --request POST \
--url https://api.wppfy.com/community/editgroups \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"community": "120363153742561022@g.us",
"groupjids": [
"120363324255083289@g.us",
"120363308883996631@g.us"
]
}
'import requests
url = "https://api.wppfy.com/community/editgroups"
payload = {
"community": "120363153742561022@g.us",
"groupjids": ["120363324255083289@g.us", "120363308883996631@g.us"]
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
community: '120363153742561022@g.us',
groupjids: ['120363324255083289@g.us', '120363308883996631@g.us']
})
};
fetch('https://api.wppfy.com/community/editgroups', 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://api.wppfy.com/community/editgroups",
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([
'community' => '120363153742561022@g.us',
'groupjids' => [
'120363324255083289@g.us',
'120363308883996631@g.us'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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://api.wppfy.com/community/editgroups"
payload := strings.NewReader("{\n \"community\": \"120363153742561022@g.us\",\n \"groupjids\": [\n \"120363324255083289@g.us\",\n \"120363308883996631@g.us\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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://api.wppfy.com/community/editgroups")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"community\": \"120363153742561022@g.us\",\n \"groupjids\": [\n \"120363324255083289@g.us\",\n \"120363308883996631@g.us\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/community/editgroups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"community\": \"120363153742561022@g.us\",\n \"groupjids\": [\n \"120363324255083289@g.us\",\n \"120363308883996631@g.us\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "community updated",
"success": [
"<string>"
],
"failed": [
"<string>"
]
}Grupos y Comunidades
Gestionar grupos en una comunidad
Agrega o elimina grupos de una comunidad de WhatsApp. Solo los administradores de la comunidad pueden ejecutar estas operaciones.
Funcionalidades
- Agregar múltiples grupos simultáneamente a una comunidad
- Eliminar grupos de una comunidad existente
- Admite operaciones por lotes
Limitaciones
- Los grupos deben existir previamente
- La comunidad debe existir y el usuario debe ser administrador
- Los grupos ya vinculados no se pueden agregar de nuevo
- Los grupos no vinculados no se pueden eliminar
Acciones Disponibles
add: Agrega los grupos especificados a la comunidadremove: Elimina los grupos especificados de la comunidad
POST
/
community
/
editgroups
Gestionar grupos en una comunidad
curl --request POST \
--url https://api.wppfy.com/community/editgroups \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"community": "120363153742561022@g.us",
"groupjids": [
"120363324255083289@g.us",
"120363308883996631@g.us"
]
}
'import requests
url = "https://api.wppfy.com/community/editgroups"
payload = {
"community": "120363153742561022@g.us",
"groupjids": ["120363324255083289@g.us", "120363308883996631@g.us"]
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
community: '120363153742561022@g.us',
groupjids: ['120363324255083289@g.us', '120363308883996631@g.us']
})
};
fetch('https://api.wppfy.com/community/editgroups', 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://api.wppfy.com/community/editgroups",
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([
'community' => '120363153742561022@g.us',
'groupjids' => [
'120363324255083289@g.us',
'120363308883996631@g.us'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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://api.wppfy.com/community/editgroups"
payload := strings.NewReader("{\n \"community\": \"120363153742561022@g.us\",\n \"groupjids\": [\n \"120363324255083289@g.us\",\n \"120363308883996631@g.us\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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://api.wppfy.com/community/editgroups")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"community\": \"120363153742561022@g.us\",\n \"groupjids\": [\n \"120363324255083289@g.us\",\n \"120363308883996631@g.us\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/community/editgroups")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"community\": \"120363153742561022@g.us\",\n \"groupjids\": [\n \"120363324255083289@g.us\",\n \"120363308883996631@g.us\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "community updated",
"success": [
"<string>"
],
"failed": [
"<string>"
]
}Autorizaciones
Cuerpo
application/json
JID (identificador único) de la comunidad
Ejemplo:
"120363153742561022@g.us"
Tipo de operación a realizar:
- add - Agrega grupos a la comunidad
- remove - Elimina grupos de la comunidad
Opciones disponibles:
add, remove Lista de JIDs de los grupos para agregar o eliminar
Minimum array length:
1Pattern:
^[0-9]+@g.us$Ejemplo:
[
"120363324255083289@g.us",
"120363308883996631@g.us"
]
