LetsBot Meniu
Începeți Română Limbă

Meta Business Partner Companie înregistrată în Marea Britanie

Limbă

Messages · endpoint API

GET /api/v1/message/fetch

Fetch messages

Fetch the most recent messages of the WhatsApp session (limit, default 25).

Fetch the most recent messages of the WhatsApp session (limit, default 25). No date filter.

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.

To read stored messages by date — incoming and outgoing, on any channel — use Message Archive → Get messages by date.

Exemplu de cerere

curl -G "https://letsbot.net/api/v1/message/fetch" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json"
const response = await fetch("https://letsbot.net/api/v1/message/fetch", {
  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/message/fetch');

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/message/fetch",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
    },
)

print(response.json())

Răspunsuri

Fetch Messages200
(corp gol)
409 — official number409
{
    "success": false,
    "Status": false,
    "error_code": "USE_MESSAGES_ARCHIVE",
    "Message": "GET /api/v1/message/fetch 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"
    }
}

Pregătiți când ești și tu

Încearcă acest endpoint pe propriul număr

API-ul funcționează în perioada de probă gratuită. Creează un cont, conectează numărul tău de WhatsApp și copiază cheia din API → Date de autentificare.