LetsBot Menu
Začať Slovenčina Jazyk

Meta Business Partner Spoločnosť registrovaná vo Veľkej Británii

Jazyk

Messages · endpoint API

GET /api/v1/message/id

Get message by Id

Get message content info with message id in phone chat number.

Get message content info with message id in phone chat number. In the data of the response , The body of the data response is the message content**. The chatName** is the phone number that receive this message. messageType is the type of the message that sent. remoteJid is the phone whatsapp account. Time is the time of the message in timestamp format. TimeFormatted is the time of the message in Format _ Dayname, Daynumber MonthName Year Hours:Min:Sec ZoneType_. There are different types of response depend on the message type. You can see Examples of the response in different types below the request.

Parametre dopytu

ParameterPovinnéPríkladPopis
phone Áno {{phone}} phone number with country code
messageID Áno BAE5690364E55771 Message Id

Ukážková požiadavka

curl -G "https://letsbot.net/api/v1/message/id" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  --data-urlencode "phone=9665xxxxxxxx" \
  --data-urlencode "messageID=BAE5690364E55771"
const response = await fetch("https://letsbot.net/api/v1/message/id?phone=%7B%7Bphone%7D%7D&messageID=BAE5690364E55771", {
  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/id?phone=%7B%7Bphone%7D%7D&messageID=BAE5690364E55771');

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/id",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
    },
    params={
        "phone": "9665xxxxxxxx",
        "messageID": "BAE5690364E55771",
    },
)

print(response.json())

Odpovede

Failed Response202
(prázdne telo)
Success Response (Text)200
(prázdne telo)
Image Message Response200
(prázdne telo)
Video Message Response200
(prázdne telo)
File Message Response200
(prázdne telo)
GIF Message Response200
(prázdne telo)
Audio Message Response200
(prázdne telo)
Button Text Message Response200
(prázdne telo)

Pripravení, keď budete vy

Vyskúšajte tento endpoint na vlastnom čísle

API funguje počas bezplatnej skúšobnej verzie. Vytvorte si účet, pripojte svoje číslo WhatsApp a skopírujte kľúč v časti API → Overovacie údaje.