Get Group Info Admin Only Setting
Check if only admins can modify group info in a WhatsApp group
Get Group Info Admin Only Setting
This endpoint allows you to check whether only administrators can modify group information (such as name, description, and picture) in a WhatsApp group.
Endpoint
GET /{sessionId}/groups/{groupId}/settings/security/info-admin-only
Headers
Name | Type | Required | Description |
---|---|---|---|
Authorization | string | Yes | Bearer token for authentication |
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
sessionId | string | Yes | The session ID |
groupId | string | Yes | The group ID |
Response
{
"enabled": true,
"changedAt": "2023-10-27T10:30:00Z",
"changedBy": "user_jid@c.us"
}
Examples
curl -X GET "https://api.wasend.dev/{sessionId}/groups/{groupId}/settings/security/info-admin-only" \
-H "Authorization: Bearer YOUR_API_KEY"
import { WasendClient } from '@wasend/core';
const client = new WasendClient({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.wasend.dev'
});
const sessionId = "yourSessionId";
const groupId = "yourGroupId";
// Get group info admin only setting
const setting = await client.getGroupInfoAdminOnly(sessionId, groupId);
console.log('Is info admin only:', setting.enabled);
if (setting.changedAt) {
console.log('Changed at:', setting.changedAt);
console.log('Changed by:', setting.changedBy);
}
const { WasendClient } = require('@wasend/core');
const client = new WasendClient({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.wasend.dev'
});
const sessionId = "yourSessionId";
const groupId = "yourGroupId";
// Get group info admin only setting
client.getGroupInfoAdminOnly(sessionId, groupId)
.then(setting => {
console.log('Is info admin only:', setting.enabled);
if (setting.changedAt) {
console.log('Changed at:', setting.changedAt);
console.log('Changed by:', setting.changedBy);
}
})
.catch(error => {
console.error('Error:', error);
});
from wasend import WasendClient
client = WasendClient(
api_key='YOUR_API_KEY',
base_url='https://api.wasend.dev'
)
session_id = "yourSessionId"
group_id = "yourGroupId"
# Get group info admin only setting
setting = client.get_group_info_admin_only(
session_id=session_id,
group_id=group_id
)
print(f"Is info admin only: {setting.enabled}")
if setting.changed_at:
print(f"Changed at: {setting.changed_at}")
print(f"Changed by: {setting.changed_by}")
package main
import (
"fmt"
"log"
"github.com/wasenddev/wasend-sdk-go/wasendcore"
)
func StringPtr(s string) *string { return &s }
func main() {
client := wasendcore.NewWasendClient(&wasendcore.WasendConfig{
ApiKey: StringPtr("YOUR_API_KEY"),
BaseUrl: StringPtr("https://api.wasend.dev"),
})
sessionId := "yourSessionId"
groupId := "yourGroupId"
// Get group info admin only setting
setting, err := client.GetGroupInfoAdminOnly(sessionId, groupId)
if err != nil {
log.Fatalf("Error getting group info admin only setting: %v", err)
}
fmt.Printf("Is info admin only: %t\n", setting.Enabled)
if setting.ChangedAt != nil {
fmt.Printf("Changed at: %s\n", *setting.ChangedAt)
fmt.Printf("Changed by: %s\n", *setting.ChangedBy)
}
}
using Wasend.Core;
using System;
using System.Threading.Tasks;
public class Example
{
public static async Task Main(string[] args)
{
var config = new WasendConfig
{
ApiKey = "YOUR_API_KEY"
};
var client = new WasendClient(config);
string sessionId = "yourSessionId";
string groupId = "yourGroupId";
// Get group info admin only setting
var setting = client.GetGroupInfoAdminOnly(sessionId, groupId);
Console.WriteLine($"Is info admin only: {setting.Enabled}");
if (setting.ChangedAt != null)
{
Console.WriteLine($"Changed at: {setting.ChangedAt}");
Console.WriteLine($"Changed by: {setting.ChangedBy}");
}
}
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient httpClient = HttpClient.newHttpClient();
String sessionId = "yourSessionId";
String groupId = "yourGroupId";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.wasend.dev/" + sessionId + "/groups/" + groupId + "/settings/security/info-admin-only"))
.header("Authorization", "Bearer YOUR_API_KEY")
.GET()
.build();
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Response: " + response.body());
}
}
<?php
$sessionId = 'yourSessionId';
$groupId = 'yourGroupId';
$url = "https://api.wasend.dev/{$sessionId}/groups/{$groupId}/settings/security/info-admin-only";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_KEY'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
require 'net/http';
require 'uri';
require 'json';
session_id = 'yourSessionId'
group_id = 'yourGroupId'
uri = URI("https://api.wasend.dev/#{session_id}/groups/#{group_id}/settings/security/info-admin-only")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true # For HTTPS
request_obj = Net::HTTP::Get.new(uri.request_uri)
request_obj['Authorization'] = 'Bearer YOUR_API_KEY'
response = http.request(request_obj)
puts "Response: #{response.body}"
import Foundation
let sessionId = "yourSessionId"
let groupId = "yourGroupId"
let url = URL(string: "https://api.wasend.dev/\(sessionId)/groups/\(groupId)/settings/security/info-admin-only")!
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.setValue("Bearer YOUR_API_KEY", forHTTPHeaderField: "Authorization")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let data = data, let responseString = String(data: data, encoding: .utf8) {
print("Response: \(responseString)")
}
}
task.resume()
use reqwest::Client;
use serde_json::Value;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let session_id = "yourSessionId";
let group_id = "yourGroupId";
let url = format!("https://api.wasend.dev/{}/groups/{}/settings/security/info-admin-only", session_id, group_id);
let response_text = client
.get(&url)
.header("Authorization", "Bearer YOUR_API_KEY")
.send()
.await?
.text()
.await?;
println!("Response: {}", response_text);
Ok(())
}
Response Fields
Field | Type | Description |
---|---|---|
enabled | boolean | Whether the "info admin only" setting is enabled. |
changedAt | string | Optional. ISO 8601 timestamp of when the setting was last changed. |
changedBy | string | Optional. JID of the user/admin who last changed the setting. |
Error Codes
Code | Description |
---|---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Not authorized to get this setting |
404 | Not Found - Session or group not found |
429 | Too many requests - Rate limit exceeded |
500 | Internal server error |
Notes
- This setting determines whether only group administrators can modify group information (name, description, picture).
- When
enabled
istrue
, regular participants cannot change these details. - When
enabled
isfalse
, all participants can modify group information. - Only group administrators can typically check this setting via WhatsApp, but the API allows retrieval by any authenticated user with access to the session and group.