Load a chat's history
load_historyFetch older WhatsApp messages from the account holder's phone, including attachments and reactions, to page back through chat history beyond what Parley has already synced.
Instructions
Fetch a chat's older messages from the account holder's phone, as WhatsApp's own "get older messages from your phone" does: the count messages before the oldest one Parley has (e.g. from before the account was linked, or while the chat was ignored), with their attachments and reactions. Call it again to go further back, count at a time. Waits up to about 20 seconds for the phone, which must be online; answered says whether it replied. Answered, it returns the older messages it fetched; not, the chat's latest messages as Parley has them. Afterwards they're in read_inbox too. Like read_inbox, it says what's new since the chat was last read (new_since_last_read, new: true, new_reactions; older history fetched now isn't new) and marks what it returns as read unless mark_read is false — and then, by default, sends read receipts on WhatsApp too (see read_receipts).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | How many older messages to fetch (default 20, at most 50). | |
| chat_id | Yes | The chat (chat_id from list_chats or read_inbox). | |
| mark_read | No | Mark what this returns as read (default true). Pass false to look without changing what counts as new. | |
| connection_id | No | Which of your accounts: a connection id from list_connections, or the account's number. Optional when only one account fits. Left out, it's the account that has the chat. | |
| read_receipts | No | Also mark the messages this returns read on WhatsApp itself, as opening the chat on the phone would. On by default whenever this marks them read (each number's setting in Parley); pass false to read without telling the sender. The senders see blue ticks only if that number's WhatsApp has read receipts on; otherwise only its own devices mark the chat read. On a number whose read receipts the account holder turned off in Parley, none are sent. |