Group metadata (light)
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone} \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}"
headers = {"Client-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Client-Token': '<api-key>'}};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}', 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.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Client-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"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Client-Token", "<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.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Client-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyGroups
Group metadata (light)
Returns group metadata without the invitation link
GET
/
instances
/
{instanceId}
/
token
/
{token}
/
light-group-metadata
/
{phone}
Group metadata (light)
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone} \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}"
headers = {"Client-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'Client-Token': '<api-key>'}};
fetch('https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}', 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.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Client-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"
"net/http"
"io"
)
func main() {
url := "https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Client-Token", "<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.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/light-group-metadata/{phone}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Client-Token"] = '<api-key>'
response = http.request(request)
puts response.read_bodyOverview
This method returns the group metadata with all group information and its participants except for the group invitation link.The only difference between this method and the Group Metadata is that this one does not return the group invitation link, as obtaining that link can be costly and slightly slow at times. If you need the link, use the Get group invitation link method.
Attributes
Header
Your instance ID. Available in the Z-API panel under Instances.
Your Z-API instance token.
Path
Group ID/Phone
Response
200
{
"phone": "120363019502650977-group",
"description": "Z-API Group",
"owner": "5511999999999",
"subject": "My group on Z-API",
"creation": 1588721491000,
"invitationLink": null,
"communityId": null,
"adminOnlyMessage": false,
"adminOnlySettings": false,
"requireAdminApproval": false,
"isGroupAnnouncement": false,
"participants": [
{
"phone": "5511888888888",
"isAdmin": false,
"isSuperAdmin": false
},
{
"phone": "5511777777777",
"isAdmin": true,
"isSuperAdmin": false,
"short": "ZAPIs",
"name": "ZAPIs Boys"
}
],
"subjectTime": 1617805323000,
"subjectOwner": "554497050785"
}
405
Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.415
If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.⌘I