Search Newsletters
#
Method#
/search-newsletterPOST
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/search-newsletter
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptThis method returns a list of newsletter data based on the search performed using filters provided in the request body.
#
Attributes#
RequiredAttributes | Type | Description |
---|---|---|
limit | number | Limit of records to be listed |
filters | object | Object with filters to be applied |
Object (filters)
Attributes | Type | Description |
---|---|---|
countryCodes | array string | Array with country codes (https://www.iban.com/country-codes) |
#
OptionalAttributes | Type | Description |
---|---|---|
view | string | View filter (RECOMMENDED, TRENDING, POPULAR, NEW) |
searchText | string | Text filtering |
#
Request Body#
URLMethod
POST
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/search-newsletter
#
Body#
Response#
200Attributes | Type | Description |
---|---|---|
id | string | Newsletter ID |
name | string | Newsletter name |
description | string | Newsletter description |
subscribersCount | string | Number of newsletter followers |
picture | string | Newsletter's image URL |
Example
Attribute "cursor" in the response object
The WhatsApp API provides the "limit" attribute to perform newsletter searches, which means there is pagination of results. However, the response does not indicate the "cursor" of the records. Therefore, for now, the "cursor" attribute will always be "null" until WhatsApp implements this functionality.
#
405In 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.
#
415If 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."