Skip to main content

Newsletter Metadata

Method#

/newsletter/metadata#

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/newsletter/metadata/{newsletterId}

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

This method returns the metadata of a newsletter, including all newsletter information and its views.


Attributes#

Required#

AttributesTypeDescription
idstringNewsletter ID

Request Params#

URL#

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/newsletter/metadata/{newsletterId}

warning

The newsletter ID must always include the "@newsletter" suffix, as this is the standard used by WhatsApp itself.


Response#

200#

AttributesTypeDescription
idstringNewsletter ID
creationTimetimestampTimestamp of the newsletter's creation date
statestringNewsletter state (ACTIVE, NON_EXISTING)
namestringNewsletter name
descriptionstringNewsletter description
subscribersCountstringNumber of newsletter followers
inviteLinkstringNewsletter's invite link
verificationstringIndicates whether the newsletter is verified or not (VERIFIED, UNVERIFIED)
picturestringNewsletter's image URL
previewstringNewsletter's image preview URL
viewMetadataobjectObject with view information

Object (viewMetadata)

AttributesTypeDescription
mutestringIndicates whether the newsletter is muted or not (ON, OFF)
rolestringIndicates if the user is the owner or a subscriber (OWNER, SUBSCRIBER)

Example

{
"id": "999999999999999999@newsletter",
"creationTime": "1695643504",
"state": "ACTIVE",
"name": "Z-API",
"description": "Official Z-API Newsletter",
"subscribersCount": "123",
"inviteLink": "https://www.whatsapp.com/channel/0029Va5Xk71a",
"verification": "VERIFIED",
"picture": "https://mmg.whatsapp.net/v/t61.24694-24/383686038_859672472421500_990610487096734362_n.jpg?ccb=11-4&oh=01_AdS-Wk3RSfXmtEqDA4-LTFaZQILXZSprywV8EwNoZPOaGw&oe=651EF162&_nc_sid=000000&_nc_cat=111",
"preview": "https://mmg.whatsapp.net/v/t61.24694-24/383686038_859672472421500_990610487096734362_n.jpg?stp=dst-jpg_s192x192&ccb=11-4&oh=01_AdRltWYOZftf0cnm-GNw5RRGoxQ53nJR9zzxxot_N7JQCw&oe=651EF162&_nc_sid=000000&_nc_cat=111",
"viewMetadata": {
"mute": "OFF",
"role": "OWNER"
}
}

405#

In this case, ensure that you are correctly sending the method specification, i.e., check if you sent the 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" to the headers of the request for the object you are sending, mostly "application/json."


Code#