LetsBot Menu
Bắt đầu Tiếng Việt Ngôn ngữ

Đối tác kinh doanh của Meta Công ty đăng ký tại Vương quốc Anh

Ngôn ngữ

Messages · Endpoint API

POST /api/v1/carousel Mới

Send carousel (Messenger / Instagram)

Send a card carousel to a Facebook Messenger or Instagram conversation.

Send a card carousel to a Facebook Messenger or Instagram conversation.

Required: recipient (the Messenger PSID or Instagram IGSID), cards (1–10 cards, each with a title).

Optional: platform (messenger default, or instagram); per card subtitle, image_url, url and up to 3 buttons.

Channels: Messenger and Instagram channels only; not WhatsApp.

Nội dung JSON

{
  "recipient": "1234567890123456",
  "platform": "messenger",
  "cards": [
    {
      "title": "Epoxy kit 5 kg",
      "subtitle": "Clear, UV resistant",
      "image_url": "https://example.com/kit-5.jpg",
      "url": "https://example.com/kit-5"
    },
    {
      "title": "Epoxy kit 20 kg",
      "subtitle": "Best value",
      "image_url": "https://example.com/kit-20.jpg",
      "url": "https://example.com/kit-20"
    }
  ]
}

Ví dụ yêu cầu

curl -X POST "https://letsbot.net/api/v1/carousel" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "recipient": "1234567890123456",
  "platform": "messenger",
  "cards": [
    {
      "title": "Epoxy kit 5 kg",
      "subtitle": "Clear, UV resistant",
      "image_url": "https://example.com/kit-5.jpg",
      "url": "https://example.com/kit-5"
    },
    {
      "title": "Epoxy kit 20 kg",
      "subtitle": "Best value",
      "image_url": "https://example.com/kit-20.jpg",
      "url": "https://example.com/kit-20"
    }
  ]
}'
const response = await fetch("https://letsbot.net/api/v1/carousel", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_LB_API_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "recipient": "1234567890123456",
    "platform": "messenger",
    "cards": [
      {
        "title": "Epoxy kit 5 kg",
        "subtitle": "Clear, UV resistant",
        "image_url": "https://example.com/kit-5.jpg",
        "url": "https://example.com/kit-5"
      },
      {
        "title": "Epoxy kit 20 kg",
        "subtitle": "Best value",
        "image_url": "https://example.com/kit-20.jpg",
        "url": "https://example.com/kit-20"
      }
    ]
  }),
});

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

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

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_LB_API_KEY',
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
        "recipient": "1234567890123456",
        "platform": "messenger",
        "cards": [
            {
                "title": "Epoxy kit 5 kg",
                "subtitle": "Clear, UV resistant",
                "image_url": "https://example.com/kit-5.jpg",
                "url": "https://example.com/kit-5"
            },
            {
                "title": "Epoxy kit 20 kg",
                "subtitle": "Best value",
                "image_url": "https://example.com/kit-20.jpg",
                "url": "https://example.com/kit-20"
            }
        ]
    }
    JSON,
]);

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

print_r($data);
import requests

response = requests.request(
    "POST",
    "https://letsbot.net/api/v1/carousel",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "recipient": "1234567890123456",
        "platform": "messenger",
        "cards": [
            {
                "title": "Epoxy kit 5 kg",
                "subtitle": "Clear, UV resistant",
                "image_url": "https://example.com/kit-5.jpg",
                "url": "https://example.com/kit-5",
            },
            {
                "title": "Epoxy kit 20 kg",
                "subtitle": "Best value",
                "image_url": "https://example.com/kit-20.jpg",
                "url": "https://example.com/kit-20",
            },
        ],
    },
)

print(response.json())

Sẵn sàng khi bạn sẵn sàng

Dùng thử endpoint này với số của bạn

API hoạt động trong thời gian dùng thử miễn phí. Tạo tài khoản, kết nối số WhatsApp và sao chép khóa của bạn tại API → Dữ liệu xác thực.