0.0.4-alpha ⢠Published 10 months ago
@mimamch/qontak v0.0.4-alpha
Mekari Qontak "Whatsapp" Package Library
Visit Official API Documentation Docs Qontak. And Visit Mekari Qontak for more information.
Installation
npm install @mimamch/qontakUsage
Import package into your code
import qontak from "@mimamch/qontak";
// or for CommonJS
const qontak = require("@mimamch/qontak");Create instance
const client = qontak.createClient({
username: "YOUR_USERNAME",
password: "YOUR_PASSWORD",
clientId: "YOUR_CLIENT_ID",
clientSecret: "YOUR_CLIENT_SECRET",
});š Send your first OTP message
ā ļø Note: You need to create an OTP template first in the Qontak dashboard.
await client.sendWhatsappMessageOutboundDirect({
message_template_id: "YOUR_TEMPLATE_ID",
channel_integration_id: "YOUR_CHANNEL_INTEGRATION_ID",
to_number: "TARGET_PHONE_NUMBER",
language: {
code: "id", // "en" or "id"
},
parameters: {
body: [
{
key: "1",
value: "123456",
value_text: "123456",
},
],
buttons: [
{
index: "0",
type: "url",
value: "123456",
},
],
},
});