LetsBot Menu
Inizia ora Italiano Lingua

Meta Business Partner Società registrata nel Regno Unito

Lingua

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>.

Parametri di query

ParametroObbligatorioEsempioDescrizione
phone Sì {{phone2}}
limit Sì 25
cursorId Sì REDACTED
cursorFromMe Sì true

Esempio di richiesta

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())

Risposte

success response200
(corpo vuoto)
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"
    }
}

Pronti quando lo sei tu

Prova questo endpoint con il tuo numero

L’API funziona durante la prova gratuita. Crea un account, collega il tuo numero WhatsApp e copia la chiave da API → Dati di autenticazione.