KYZNKYZN Docs

Sleekflow WhatsApp OTP

Integrasi WhatsApp Official API untuk autentikasi OTP

Setup

Buat Template di Meta

Alt text Buka WhatsApp Manager, klik Create Template, pilih Authentication Template, lalu isi fields sesuai kebutuhan. Alt text Alt text

Konfigurasi Sleekflow

Alt text

Buka Sleekflow Channels, pilih WABA yang sama, gunakan format Platform API Integration:

Template Config
{
  "whatsappCloudApiTemplateMessageObject": {
    "language": "en",
    "templateName": "otp_whatsapp",
    "components": [
      {
        "type": "BODY",
        "parameters": [{ "type": "text", "text": "{{1}}" }]
      },
      {
        "type": "button",
        "sub_type": "URL",
        "index": 0,
        "parameters": [{ "type": "text", "text": "{{1}}" }]
      }
    ]
  }
}

Alt text

Setup Environment Variables

.env
SLEEKFLOW_API_KEY=your_api_key
SLEEKFLOW_API_URL=https://api.sleekflow.io/api/message/send/json
SLEEKFLOW_SENDER_PHONE=628118601000
SLEEKFLOW_CHANNEL=whatsappcloudapi
SLEEKFLOW_TEMPLATE_NAME=otp_whatsapp
SLEEKFLOW_TEMPLATE_LANGUAGE=en
SLEEKFLOW_TEMPLATE_NAMESPACE=your_namespace
SLEEKFLOW_TEMPLATE_HAS_BUTTON=true

SLEEKFLOW_TEMPLATE_NAMESPACE hanya diperlukan untuk channel 360Dialog.


Payload API

payload.json
{
  "channel": "whatsappcloudapi",
  "from": "628118601000",
  "to": "6281234567890",
  "messageType": "template",
  "extendedMessage": {
    "whatsappCloudApiTemplateMessageObject": {
      "templateName": "otp_whatsapp",
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "parameters": [{ "type": "text", "text": "123456" }]
        },
        {
          "type": "button",
          "sub_type": "URL",
          "index": 0,
          "parameters": [{ "type": "text", "text": "123456" }]
        }
      ]
    }
  }
}

Set SLEEKFLOW_TEMPLATE_HAS_BUTTON=false, hilangkan komponen button.

payload.json
{
  "channel": "whatsappcloudapi",
  "from": "628118601000",
  "to": "6281234567890",
  "messageType": "template",
  "extendedMessage": {
    "whatsappCloudApiTemplateMessageObject": {
      "templateName": "otp_whatsapp",
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "parameters": [{ "type": "text", "text": "123456" }]
        }
      ]
    }
  }
}
payload.json
{
  "channel": "whatsapp360dialog",
  "from": "628118601000",
  "to": "6281234567890",
  "messageType": "template",
  "extendedMessage": {
    "whatsapp360DialogTemplateMessage": {
      "templateName": "otp_whatsapp",
      "templateNamespace": "your_namespace",
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "parameters": [{ "type": "text", "text": "123456" }]
        }
      ]
    }
  }
}

Untuk channel non-WhatsApp template:

payload.json
{
  "channel": "sms",
  "from": "628118601000",
  "to": "6281234567890",
  "messageType": "text",
  "messageContent": "Your OTP code is: 123456"
}

API Request

HTTP Request
POST https://api.sleekflow.io/api/message/send/json
Content-Type: application/json
X-Sleekflow-Api-Key: <API_KEY>
Last Update: 26 Desember 2025 pukul 13.50

On this page