LetsBot Μενού
Ξεκινήστε Ελληνικά Γλώσσα

Meta Business Partner Εταιρεία εγγεγραμμένη στο Ηνωμένο Βασίλειο

Γλώσσα

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

Παράμετροι ερωτήματος

ΠαράμετροςΥποχρεωτικόΠαράδειγμαΠεριγραφή
phone Ναι {{phone2}}
limit Ναι 25
cursorId Ναι REDACTED
cursorFromMe Ναι true

Παράδειγμα αιτήματος

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

Απαντήσεις

success response200
(κενό σώμα)
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"
    }
}

Έτοιμοι όποτε είστε κι εσείς

Δοκιμάστε αυτό το endpoint με τον δικό σας αριθμό

Το API λειτουργεί κατά τη δωρεάν δοκιμή. Δημιουργήστε λογαριασμό, συνδέστε τον αριθμό WhatsApp σας και αντιγράψτε το κλειδί σας από API → Δεδομένα ταυτοποίησης.