LetsBot Meny
Kom igång Svenska Språk

Meta Business Partner Registrerat företag i Storbritannien

Språk

Messages · API-endpoint

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

Frågeparametrar

ParameterObligatoriskExempelBeskrivning
phone Ja {{phone}}
messageID Ja BAE509D204172AC0

Formulärfält

FältExempel
phone{{phone}}
messageIDBAE509D204172AC0

Exempelanrop

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

Svar

Delete Message by Id200
(tomt innehåll)

Redo när du är det

Testa den här endpointen med ditt eget nummer

API:t fungerar under gratisperioden. Skapa ett konto, anslut ditt WhatsApp-nummer och kopiera din nyckel under API → Autentiseringsdata.