Skip to main content
GET
/
api
/
{session}
/
channels
/
{id}
/
messages
/
preview
Preview channel messages
curl --request GET \
  --url https://{host}/api/{session}/channels/{id}/messages/preview \
  --header 'apikey: <api-key>'
{
  "messages": [
    {
      "id": "msg_123",
      "content": "Bem-vindo ao nosso channel!",
      "timestamp": 1672531200
    },
    {
      "id": "msg_124",
      "content": "Confira as novidades desta semana",
      "timestamp": 1672617600
    }
  ]
}

Description

This endpoint allows you to preview messages of um channel without needing to follow it. It is useful to see the content of the channel before deciding whether to follow it.

URL Parameters

session
string
required
WhatsApp unique authenticated session ID
id
string
required
ID único of the channel que deis visualizar as messages

Parâmetros of Query

invite
string
required
Code of invite of the channel
limit
number
default:"10"
Número maximum of messages a retornar (default: 10)

Response

messages
array
Array contendo as messages of the channel
{
  "messages": [
    {
      "id": "msg_123",
      "content": "Bem-vindo ao nosso channel!",
      "timestamp": 1672531200
    },
    {
      "id": "msg_124",
      "content": "Confira as novidades desta semana",
      "timestamp": 1672617600
    }
  ]
}

Status Codes

  • 200 - Prévia obtained successfully
  • 400 - Invalid parameters or faltandthe code of invite
  • 401 - Unauthorized
  • 404 - Channel not found
  • 500 - Internal server error

Usage Example

curl -X GET "https://api.wappfy.com.br/api/my-session/channels/123456789@newsletter/messages/preview?invite=ABC123&limit=10"

Authorizations

apikey
string
header
required

Your Wappfy API key (get it at dash.wappfy.com.br)

Path Parameters

session
string
required

Session name (instanceName)

id
any
required

Channel ID or invite code

Query Parameters

downloadMedia
boolean
default:false
required
limit
number
default:10
required

Response

200 - application/json
reactions
object
required
Example:
{ "👍": 10, "❤️": 5 }
message
object
required
viewCount
number
required
I