LetsBot เมนู
เริ่มต้นใช้งาน ไทย ภาษา

Meta Business Partner บริษัทจดทะเบียนในสหราชอาณาจักร

ภาษา

Messages · เอนด์พอยต์ API

POST /api/v1/list/message

Send list message

You can send list message select to phone number.

You can send list message select to phone number. You need to send the body, footer, title(optional), buttonText and sections(array) of the message. Every section array has two index which is title and rows , for every rows has title, rowid and description(optional).You can see the result of the sections in image below. Id of the message in the key of the data of the response. In the Message of the data of the response , You can see listMessage that contain list message info (title, description, buttonText, listType, sections, etc) , messageTimesamp format and status of the message. <img src='https://content.pstmn.io/cd6efe52-5a20-48e2-ae2d-e9b235b089f6/aW1hZ2UucG5n' alt='' height='484' width='436'>

ฟิลด์ฟอร์ม

ฟิลด์ตัวอย่าง
phone{{phone}}
bodyBody of message
titleTilte of message
footerFooter of message
buttonTextRequired, text on the button to view the list
sections[0][title]Section 1 Text
sections[0][rows][0][title]Option 1
sections[0][rows][0][rowId]Option1
sections[0][rows][0][description]This is description
sections[0][rows][1][title]Option 2
sections[0][rows][1][rowId]Option2

ตัวอย่างคำขอ

curl -X POST "https://letsbot.net/api/v1/list/message" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  -F "phone=9665xxxxxxxx" \
  -F "body=Body of message" \
  -F "title=Tilte of message" \
  -F "footer=Footer of message" \
  -F "buttonText=Required, text on the button to view the list" \
  -F "sections[0][title]=Section 1 Text" \
  -F "sections[0][rows][0][title]=Option 1" \
  -F "sections[0][rows][0][rowId]=Option1" \
  -F "sections[0][rows][0][description]=This is description" \
  -F "sections[0][rows][1][title]=Option 2" \
  -F "sections[0][rows][1][rowId]=Option2"
const response = await fetch("https://letsbot.net/api/v1/list/message", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_LB_API_KEY",
    "Accept": "application/json",
  },
  body: new URLSearchParams({
    "phone": "9665xxxxxxxx",
    "body": "Body of message",
    "title": "Tilte of message",
    "footer": "Footer of message",
    "buttonText": "Required, text on the button to view the list",
    "sections[0][title]": "Section 1 Text",
    "sections[0][rows][0][title]": "Option 1",
    "sections[0][rows][0][rowId]": "Option1",
    "sections[0][rows][0][description]": "This is description",
    "sections[0][rows][1][title]": "Option 2",
    "sections[0][rows][1][rowId]": "Option2",
  }),
});

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

$ch = curl_init('https://letsbot.net/api/v1/list/message');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_LB_API_KEY',
        'Accept: application/json',
    ],
    CURLOPT_POSTFIELDS => http_build_query([
        'phone' => '9665xxxxxxxx',
        'body' => 'Body of message',
        'title' => 'Tilte of message',
        'footer' => 'Footer of message',
        'buttonText' => 'Required, text on the button to view the list',
        'sections[0][title]' => 'Section 1 Text',
        'sections[0][rows][0][title]' => 'Option 1',
        'sections[0][rows][0][rowId]' => 'Option1',
        'sections[0][rows][0][description]' => 'This is description',
        'sections[0][rows][1][title]' => 'Option 2',
        'sections[0][rows][1][rowId]' => 'Option2',
    ]),
]);

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

print_r($data);
import requests

response = requests.request(
    "POST",
    "https://letsbot.net/api/v1/list/message",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
    },
    data={
        "phone": "9665xxxxxxxx",
        "body": "Body of message",
        "title": "Tilte of message",
        "footer": "Footer of message",
        "buttonText": "Required, text on the button to view the list",
        "sections[0][title]": "Section 1 Text",
        "sections[0][rows][0][title]": "Option 1",
        "sections[0][rows][0][rowId]": "Option1",
        "sections[0][rows][0][description]": "This is description",
        "sections[0][rows][1][title]": "Option 2",
        "sections[0][rows][1][rowId]": "Option2",
    },
)

print(response.json())

การตอบกลับ

Success Response200
(เนื้อหาว่าง)
Failed Response202
(เนื้อหาว่าง)

พร้อมเมื่อคุณพร้อม

ลองใช้เอนด์พอยต์นี้กับหมายเลขของคุณ

API ใช้งานได้ระหว่างช่วงทดลองใช้ฟรี สร้างบัญชี เชื่อมต่อหมายเลข WhatsApp ของคุณ แล้วคัดลอกคีย์จาก API → ข้อมูลการยืนยันตัวตน