Get Group Picture
Retrieve the profile picture of a WhatsApp group
Get Group Picture
Retrieve the profile picture of a WhatsApp group.
Endpoint
GET /{sessionId}/groups/{groupId}/picture
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
{
"success": true,
"picture": {
"url": "string",
"type": "string",
"size": 0
}
}
Examples
import { WasendClient } from '@wasend/core';
const client = new WasendClient({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.wasend.dev'
});
// Get group picture
const result = await client.getGroupPicture(sessionId, groupId);
console.log('Picture URL:', result.picture.url);
const { WasendClient } = require('@wasend/core');
const client = new WasendClient({
apiKey: 'YOUR_API_KEY',
baseUrl: 'https://api.wasend.dev'
});
// Get group picture
const result = await client.getGroupPicture(sessionId, groupId);
from wasend import WasendClient
client = WasendClient(
api_key='YOUR_API_KEY',
base_url='https://api.wasend.dev'
)
# Get group picture
result = client.get_group_picture(
session_id=sessionId,
group_id=groupId
)
package main
import (
"context"
"fmt"
"log"
"github.com/wasenddev/wasend-sdk-go"
)
func main() {
client := wasend.NewClient("YOUR_API_KEY", "https://api.wasend.dev")
// Get group picture
result, err := client.GetGroupPicture(context.Background(), sessionId, groupId)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Picture URL: %s\n", result.Picture.URL)
}
using Wasend.SDK;
var client = new WasendClient("YOUR_API_KEY", "https://api.wasend.dev");
// Get group picture
var result = await client.GetGroupPictureAsync(sessionId, groupId);
import com.wasend.sdk.WasendClient;
public class Main {
public static void main(String[] args) {
WasendClient client = new WasendClient("YOUR_API_KEY", "https://api.wasend.dev");
var result = client.getGroupPicture(sessionId, groupId);
}
}
<?php
use Wasend\SDK\WasendClient;
$client = new WasendClient([
'api_key' => 'YOUR_API_KEY',
'base_url' => 'https://api.wasend.dev'
]);
// Get group picture
$result = $client->getGroupPicture($sessionId, $groupId);
require 'wasend-sdk'
client = Wasend::Client.new(
api_key: 'YOUR_API_KEY',
base_url: 'https://api.wasend.dev'
)
# Get group picture
result = client.get_group_picture(
session_id: sessionId,
group_id: groupId
)
import WasendSDK
let client = WasendClient(apiKey: "YOUR_API_KEY", baseURL: "https://api.wasend.dev")
// Get group picture
let result = try await client.getGroupPicture(
sessionId: sessionId,
groupId: groupId
)
use wasend_sdk::WasendClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = WasendClient::new("YOUR_API_KEY", "https://api.wasend.dev");
// Get group picture
let result = client.get_group_picture(
sessionId,
groupId
).await?;
println!("Picture URL: {:?}", result.picture.url);
Ok(())
}
curl -X GET "https://api.wasend.dev/{sessionId}/groups/{groupId}/picture" \
-H "Authorization: Bearer YOUR_API_KEY"
Response Fields
Field | Type | Description |
---|---|---|
success | boolean | Whether the operation was successful |
picture | object | The group picture information |
Picture Object
Field | Type | Description |
---|---|---|
url | string | URL to download the picture |
type | string | MIME type of the picture |
size | number | Size of the picture in bytes |
Error Codes
Code | Description |
---|---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Not authorized to get picture |
404 | Not Found - Session, group, or picture not found |
429 | Too many requests - Rate limit exceeded |
500 | Internal server error |
Notes
- You must be a member of the group to get its picture
- The picture URL is temporary and expires after 24 hours
- The response includes the picture's metadata
- The picture is returned as a URL to download
- The URL can be used to download the actual image
- The picture type is typically image/jpeg or image/png
- The size is in bytes