LetsBot Menú
Empezar Español Idioma

Meta Business Partner Empresa registrada en el Reino Unido

Idioma

Messages · Endpoint de la API

DELETE /api/v1/message/delete

Delete message by Id

You can delete message for phone number.

You can delete message for phone number. You need to send the message id. Id of the message in the key of the data of the response. In the data of the response you can see many options of the message (id, body, messageType, fileName if exist, author, chatName, time in timestamp format, status, etc).

Parámetros de consulta

ParámetroObligatorioEjemploDescripción
phone Sí {{phone}}
messageID Sí BAE509D204172AC0

Campos del formulario

CampoEjemplo
phone{{phone}}
messageIDBAE509D204172AC0

Ejemplo de solicitud

curl -X DELETE "https://letsbot.net/api/v1/message/delete?phone=9665xxxxxxxx&messageID=BAE509D204172AC0" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  -F "phone=9665xxxxxxxx" \
  -F "messageID=BAE509D204172AC0"
const response = await fetch("https://letsbot.net/api/v1/message/delete?phone=%7B%7Bphone%7D%7D&messageID=BAE509D204172AC0", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer YOUR_LB_API_KEY",
    "Accept": "application/json",
  },
  body: new URLSearchParams({
    "phone": "9665xxxxxxxx",
    "messageID": "BAE509D204172AC0",
  }),
});

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

$ch = curl_init('https://letsbot.net/api/v1/message/delete?phone=%7B%7Bphone%7D%7D&messageID=BAE509D204172AC0');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_LB_API_KEY',
        'Accept: application/json',
    ],
    CURLOPT_POSTFIELDS => http_build_query([
        'phone' => '9665xxxxxxxx',
        'messageID' => 'BAE509D204172AC0',
    ]),
]);

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

print_r($data);
import requests

response = requests.request(
    "DELETE",
    "https://letsbot.net/api/v1/message/delete",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
    },
    params={
        "phone": "9665xxxxxxxx",
        "messageID": "BAE509D204172AC0",
    },
    data={
        "phone": "9665xxxxxxxx",
        "messageID": "BAE509D204172AC0",
    },
)

print(response.json())

Respuestas

Delete Message by Id200
(cuerpo vacío)

Listos cuando tú lo estés

Prueba este endpoint con tu propio número

La API funciona durante la prueba gratuita. Crea una cuenta, conecta tu número de WhatsApp y copia tu clave en API → Datos de autenticación.