LetsBot Menu
Začít Čeština Jazyk

Meta Business Partner Společnost registrovaná ve Spojeném království

Jazyk

Chat · endpoint API

GET /api/v1/chat/conversation

Get chat conversation for phone

Get the conversation with one phone number from the WhatsApp session, newest first.

Get the conversation with one phone number from the WhatsApp session, newest first. Page with limit, then pass the last message's id as cursorId and its direction as cursorFromMe.

Channels: QR (WhatsApp Web) channels only. On an official WhatsApp Cloud API number this request answers 409 with "error_code": "USE_MESSAGES_ARCHIVE" and a ready-made use.example URL — call that instead.

To read stored messages on any channel, use Message Archive → Get messages by date with phone=<number>.

Parametry dotazu

ParametrPovinnéPříkladPopis
phone Ano {{phone2}}
limit Ano 25
cursorId Ano REDACTED
cursorFromMe Ano true

Ukázkový požadavek

curl -G "https://letsbot.net/api/v1/chat/conversation" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  --data-urlencode "phone={{phone2}}" \
  --data-urlencode "limit=25" \
  --data-urlencode "cursorId=REDACTED" \
  --data-urlencode "cursorFromMe=true"
const response = await fetch("https://letsbot.net/api/v1/chat/conversation?phone=%7B%7Bphone2%7D%7D&limit=25&cursorId=REDACTED&cursorFromMe=true", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_LB_API_KEY",
    "Accept": "application/json",
  },
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init('https://letsbot.net/api/v1/chat/conversation?phone=%7B%7Bphone2%7D%7D&limit=25&cursorId=REDACTED&cursorFromMe=true');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_LB_API_KEY',
        'Accept: application/json',
    ],
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($data);
import requests

response = requests.request(
    "GET",
    "https://letsbot.net/api/v1/chat/conversation",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
    },
    params={
        "phone": "{{phone2}}",
        "limit": "25",
        "cursorId": "REDACTED",
        "cursorFromMe": "true",
    },
)

print(response.json())

Odpovědi

success response200
(prázdné tělo)
409 — official number409
{
    "success": false,
    "Status": false,
    "error_code": "USE_MESSAGES_ARCHIVE",
    "Message": "GET /api/v1/chat/conversation reads a QR (WhatsApp Web) session, which official WhatsApp Cloud API numbers do not have. Read stored messages — incoming and outgoing — with GET /api/v1/messages (date_from, date_to, optional phone, cursor).",
    "use": {
        "method": "GET",
        "path": "/api/v1/messages",
        "example": "/api/v1/messages?phone=966512345678&date_from=2026-08-31&date_to=2026-09-30"
    }
}

Připraveni, až budete vy

Vyzkoušejte tento endpoint na vlastním čísle

API funguje během bezplatné zkušební verze. Vytvořte si účet, připojte své číslo WhatsApp a zkopírujte klíč v části API → Ověřovací údaje.