Fetch All Groups
curl --request GET \
--url https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance} \
--header 'apikey: <api-key>'import requests
url = "https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}', 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.l2msg.com/whatsapp/group/fetchAllGroups/{instance}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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"
"net/http"
"io"
)
func main() {
url := "https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "120363295648424210@g.us",
"subject": "Example Group",
"subjectOwner": "553198296801@s.whatsapp.net",
"subjectTime": 1714769954,
"pictureUrl": null,
"size": 1,
"creation": 1714769954,
"owner": "553198296801@s.whatsapp.net",
"desc": "optional",
"descId": "BAE57E16498982ED",
"restrict": false,
"announce": false
}
]Group Controller
Fetch All Groups
Fetch all groups
GET
/
group
/
fetchAllGroups
/
{instance}
Fetch All Groups
curl --request GET \
--url https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance} \
--header 'apikey: <api-key>'import requests
url = "https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}', 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.l2msg.com/whatsapp/group/fetchAllGroups/{instance}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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"
"net/http"
"io"
)
func main() {
url := "https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.l2msg.com/whatsapp/group/fetchAllGroups/{instance}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "120363295648424210@g.us",
"subject": "Example Group",
"subjectOwner": "553198296801@s.whatsapp.net",
"subjectTime": 1714769954,
"pictureUrl": null,
"size": 1,
"creation": 1714769954,
"owner": "553198296801@s.whatsapp.net",
"desc": "optional",
"descId": "BAE57E16498982ED",
"restrict": false,
"announce": false
}
]Authorizations
Your authorization key header
Path Parameters
Name of the instance
Query Parameters
Whether to get the group members or not
Response
200 - application/json
Ok
The ID of the group.
The subject (name) of the group.
The ID of the user who set the subject.
The timestamp when the subject was set.
The number of participants in the group.
The timestamp when the group was created.
The ID of the group owner.
Indicates if the group is restricted (only admins can send messages).
Indicates if the group is an announcement group (only admins can send messages).
URL of the group's profile picture.
The description of the group.
The ID of the description message.
Example:
[
{
"id": "120363295648424210@g.us",
"subject": "Example Group",
"subjectOwner": "553198296801@s.whatsapp.net",
"subjectTime": 1714769954,
"pictureUrl": null,
"size": 1,
"creation": 1714769954,
"owner": "553198296801@s.whatsapp.net",
"desc": "optional",
"descId": "BAE57E16498982ED",
"restrict": false,
"announce": false
}
]