GREEN-API for WhatsApp icon

GREEN-API for WhatsApp

Send and receive WhatsApp messages using Green-API.

Service → readChat

AI-generated

Summary

Read the chat history for a specified chat in WhatsApp.

Inputs

  • chatId (required) — The identifier of the chat to read, formatted as '79000000000@c.us'.
  • idMessage — Optionally specify the ID of a particular message to focus the reading operation.

Output shape

a list of chat messages

Returns the history of messages in the specified chat. If 'idMessage' is provided, the return may include only details related to that message.

Examples

Example 1: Fetch chat history for chat ID '79000000000@c.us'.

Set 'chatId' to '79000000000@c.us'.

Example 2: Read details of a specific message in the chat by providing its ID.

Set 'chatId' and 'idMessage' accordingly.

Discussion