Node.js
// Requires the documented scopes. Keep keys on your server.
// For writes, persist the request key first; inspect unknown results.
const result = await client.request("/groups/120000000000@g.us/join-requests/settings", { method: "PUT", body: {"required":true,"expectedRequired":false}, idempotencyKey: process.env.IDEMPOTENCY_KEY });
console.log(result);
{
"state": "completed",
"replayed": true,
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}WhatsApp actions
Change group approval requirement
groups:permissions on the selected group and current admin status. expectedRequired must match the current setting. Unknown results never retry.
Node.js
// Requires the documented scopes. Keep keys on your server.
// For writes, persist the request key first; inspect unknown results.
const result = await client.request("/groups/120000000000@g.us/join-requests/settings", { method: "PUT", body: {"required":true,"expectedRequired":false}, idempotencyKey: process.env.IDEMPOTENCY_KEY });
console.log(result);
{
"state": "completed",
"replayed": true,
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}