Skip to main content
GET
/
api
/
{session}
/
chats
/
{chatId}
/
messages
Obter mensagens na conversa
curl --request GET \
  --url https://{host}/api/{session}/chats/{chatId}/messages \
  --header 'apikey: <api-key>'
[
  {
    "id": "false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA",
    "timestamp": 1666943582,
    "from": "5511999999999@c.us",
    "fromMe": true,
    "source": "api",
    "to": "5511999999999@c.us",
    "participant": "<string>",
    "body": "<string>",
    "hasMedia": true,
    "media": {
      "url": "http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga",
      "mimetype": "audio/jpeg",
      "filename": "example.pdf",
      "s3": {
        "Bucket": "my-bucket",
        "Key": "default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga"
      },
      "error": null
    },
    "ack": -1,
    "ackName": "<string>",
    "author": "<string>",
    "location": {
      "description": "<string>",
      "latitude": "<string>",
      "longitude": "<string>"
    },
    "vCards": [
      "<string>"
    ],
    "_data": {},
    "replyTo": {
      "id": "AAAAAAAAAAAAAAAAAAAA",
      "participant": "5511999999999@c.us",
      "body": "Hello!",
      "_data": {}
    }
  }
]

Authorizations

apikey
string
header
required

Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)

Path Parameters

session
string
required

Nome da sessão (instanceName)

chatId
string
required

ID da Conversa

Query Parameters

downloadMedia
boolean
default:true

Baixar mídia para mensagens

limit
number
default:10
required
offset
number
filter.timestamp.lte
number

Filtrar mensagens antes deste timestamp (inclusivo) (Filter messages before this timestamp (inclusive))

filter.timestamp.gte
number

Filtrar mensagens após este timestamp (inclusivo) (Filter messages after this timestamp (inclusive))

filter.fromMe
boolean

Filtro de mim (por padrão mostra todas as mensagens) (From me filter (by default shows all messages))

filter.ack
enum<string>

Filtrar mensagens por status de confirmação

Available options:
ERROR,
PENDING,
SERVER,
DEVICE,
READ,
PLAYED

Response

200 - application/json
id
string
required

ID da mensagem

Example:

"false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA"

timestamp
number
required

Timestamp Unix de quando a mensagem foi criada

Example:

1666943582

from
string
required

ID do chat para o qual esta mensagem foi enviada

Example:

"5511999999999@c.us"

fromMe
boolean
required

Indica se a mensagem foi enviada pelo usuário atual

source
enum<string>
required

The device that sent the message - either API or APP. Available in events (webhooks/websockets) only and only "fromMe: true" messages.

Available options:
api,
app
Example:

"api"

to
string
required
  • ID for who this message is for.
  • If the message is sent by the current user, it will be the Chat to which the message is being sent.
  • If the message is sent by another user, it will be the ID for the current user.
Example:

"5511999999999@c.us"

participant
string
required

Para grupos - participante que enviou a mensagem

body
string
required

Conteúdo da mensagem

hasMedia
boolean
required

Indica se a mensagem possui mídia disponível para download

ack
enum<number>
required

Status de confirmação (ACK) da mensagem

Available options:
-1,
0,
1,
2,
3,
4
ackName
string
required

Nome do status de confirmação da mensagem

media
object

Objeto de mídia da mensagem, se houver e foi baixada

author
string

Se a mensagem foi enviada para um grupo, este campo conterá o usuário que enviou a mensagem

location
object

Informações de localização contidas na mensagem

vCards
string[]

Lista de vCards contidos na mensagem

_data
object

Mensagem em formato bruto do WhatsApp. Pode mudar a qualquer momento, use com cautela!

replyTo
object
I