List channels
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/newsletter \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/newsletter"
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}/newsletter', 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}/newsletter",
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}/newsletter"
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}/newsletter")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/newsletter")
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_body{
"id": "<string>",
"creationTime": 123,
"state": "<string>",
"name": "<string>",
"description": "<string>",
"subscribersCount": "<string>",
"inviteLink": "<string>",
"verification": "<string>",
"picture": "<string>",
"preview": "<string>",
"viewMetadata": {
"mute": "<string>",
"role": "<string>"
}
}Newsletter
List channels
Returns the list of channels you own and follow
GET
/
instances
/
{instanceId}
/
token
/
{token}
/
newsletter
List channels
curl --request GET \
--url https://api.z-api.io/instances/{instanceId}/token/{token}/newsletter \
--header 'Client-Token: <api-key>'import requests
url = "https://api.z-api.io/instances/{instanceId}/token/{token}/newsletter"
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}/newsletter', 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}/newsletter",
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}/newsletter"
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}/newsletter")
.header("Client-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.z-api.io/instances/{instanceId}/token/{token}/newsletter")
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_body{
"id": "<string>",
"creationTime": 123,
"state": "<string>",
"name": "<string>",
"description": "<string>",
"subscribersCount": "<string>",
"inviteLink": "<string>",
"verification": "<string>",
"picture": "<string>",
"preview": "<string>",
"viewMetadata": {
"mute": "<string>",
"role": "<string>"
}
}Overview
This method returns the metadata of channels you own and channels you follow.Attributes
Header
Response
200
Returns an array of channel objects.[
{
"id": "999999999999999999@newsletter",
"creationTime": 1695124988,
"state": "ACTIVE",
"name": "Channel name",
"description": "Description",
"subscribersCount": "150",
"inviteLink": "https://whatsapp.com/channel/...",
"verification": "VERIFIED",
"picture": "https://...",
"preview": "https://...",
"viewMetadata": {
"mute": "OFF",
"role": "OWNER"
}
}
]
The channel ID must always contain the @newsletter suffix, as this is the standard used by the application.