LetsBot منو
شروع کنید فارسی زبان

Meta Business Partner شرکت ثبت‌شده در بریتانیا

زبان

Messages · نقطهٔ پایانی 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).

پارامترهای پرس‌وجو

پارامترالزامینمونهتوضیح
phone بله {{phone}}
messageID بله BAE509D204172AC0

فیلدهای فرم

فیلدنمونه
phone{{phone}}
messageIDBAE509D204172AC0

نمونه درخواست

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

پاسخ‌ها

Delete Message by Id200
(بدنهٔ خالی)

هر وقت آماده بودید، ما آماده‌ایم

این نقطهٔ پایانی را روی شمارهٔ خودتان امتحان کنید

API در دورهٔ آزمایشی رایگان کار می‌کند. حساب بسازید، شمارهٔ واتس‌اپ خود را وصل کنید و کلیدتان را از API ← داده‌های احراز هویت کپی کنید.