cURL
curl -X POST \
'https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"template": "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
"variables": {
"body1": "Axel",
"body2": "Shampoo",
"body3": "$1",
"media": "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing"
},
"phone_number": "123476529999"
}'const fetch = require("node-fetch");
async function sendMessage() {
const response = await fetch(
"https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
template: "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
variables: {
body1: "Axel",
body2: "Shampoo",
body3: "$1",
media: "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing",
},
phone_number: "123476529999",
}),
}
);
const data = await response.json();
console.log(data);
}
sendMessage();package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type RequestBody struct {
Template string `json:"template"`
Variables map[string]string `json:"variables"`
PhoneNumber string `json:"phone_number"`
}
func main() {
requestBody := RequestBody{
Template: "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
Variables: map[string]string{
"body1": "Axel",
"body2": "Shampoo",
"body3": "$1",
"media": "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing"
},
PhoneNumber: "123476529999",
}
jsonData, _ := json.Marshal(requestBody)
resp, err := http.Post("https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api", "application/json", bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}import requests
url = "https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api"
payload = {
"template": "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
"variables": {
"body1": "Axel",
"body2": "Shampoo",
"body3": "$1",
"media": "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing",
"visit_website": "1"
},
"phone_number": "+123476529999"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template' => 'f10695a9-38d6-4f5f-8444-1f7bf52c6164',
'variables' => [
'body1' => 'Axel',
'body2' => 'Shampoo',
'body3' => '$1',
'media' => 'https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing',
'visit_website' => '1'
],
'phone_number' => '+123476529999'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"f10695a9-38d6-4f5f-8444-1f7bf52c6164\",\n \"variables\": {\n \"body1\": \"Axel\",\n \"body2\": \"Shampoo\",\n \"body3\": \"$1\",\n \"media\": \"https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing\",\n \"visit_website\": \"1\"\n },\n \"phone_number\": \"+123476529999\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": \"f10695a9-38d6-4f5f-8444-1f7bf52c6164\",\n \"variables\": {\n \"body1\": \"Axel\",\n \"body2\": \"Shampoo\",\n \"body3\": \"$1\",\n \"media\": \"https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing\",\n \"visit_website\": \"1\"\n },\n \"phone_number\": \"+123476529999\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"whatsapp_response_info": {
"contacts": [
{
"input": "<string>",
"wa_id": "<string>"
}
],
"messages": [
{
"id": "<string>",
"message_status": "<string>"
}
],
"messaging_product": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Templates
Send Template Message
Send a template-based message to users via their phone numbers
POST
/
api:hFrjh8a1
/
send_template_message_by_api
cURL
curl -X POST \
'https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"template": "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
"variables": {
"body1": "Axel",
"body2": "Shampoo",
"body3": "$1",
"media": "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing"
},
"phone_number": "123476529999"
}'const fetch = require("node-fetch");
async function sendMessage() {
const response = await fetch(
"https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
template: "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
variables: {
body1: "Axel",
body2: "Shampoo",
body3: "$1",
media: "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing",
},
phone_number: "123476529999",
}),
}
);
const data = await response.json();
console.log(data);
}
sendMessage();package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type RequestBody struct {
Template string `json:"template"`
Variables map[string]string `json:"variables"`
PhoneNumber string `json:"phone_number"`
}
func main() {
requestBody := RequestBody{
Template: "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
Variables: map[string]string{
"body1": "Axel",
"body2": "Shampoo",
"body3": "$1",
"media": "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing"
},
PhoneNumber: "123476529999",
}
jsonData, _ := json.Marshal(requestBody)
resp, err := http.Post("https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api", "application/json", bytes.NewBuffer(jsonData))
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}import requests
url = "https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api"
payload = {
"template": "f10695a9-38d6-4f5f-8444-1f7bf52c6164",
"variables": {
"body1": "Axel",
"body2": "Shampoo",
"body3": "$1",
"media": "https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing",
"visit_website": "1"
},
"phone_number": "+123476529999"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template' => 'f10695a9-38d6-4f5f-8444-1f7bf52c6164',
'variables' => [
'body1' => 'Axel',
'body2' => 'Shampoo',
'body3' => '$1',
'media' => 'https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing',
'visit_website' => '1'
],
'phone_number' => '+123476529999'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"f10695a9-38d6-4f5f-8444-1f7bf52c6164\",\n \"variables\": {\n \"body1\": \"Axel\",\n \"body2\": \"Shampoo\",\n \"body3\": \"$1\",\n \"media\": \"https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing\",\n \"visit_website\": \"1\"\n },\n \"phone_number\": \"+123476529999\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.insightssystem.com/api:hFrjh8a1/send_template_message_by_api")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": \"f10695a9-38d6-4f5f-8444-1f7bf52c6164\",\n \"variables\": {\n \"body1\": \"Axel\",\n \"body2\": \"Shampoo\",\n \"body3\": \"$1\",\n \"media\": \"https://drive.google.com/file/d/1D35uTbceRPmCgwxVfBJZ2yxD2lQgs0bi/view?usp=sharing\",\n \"visit_website\": \"1\"\n },\n \"phone_number\": \"+123476529999\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"whatsapp_response_info": {
"contacts": [
{
"input": "<string>",
"wa_id": "<string>"
}
],
"messages": [
{
"id": "<string>",
"message_status": "<string>"
}
],
"messaging_product": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
Your Notifyer System API Token
Body
application/json
The unique template ID used for sending the message
A JSON object containing dynamic placeholders for the message template. The keys should match the variables in your template. Common variable keys include:
- body1, body2, body3: Text variables for message content
- media: URL for image, video, or document attachments
- visit_website: URL's parameter for the dynamic button link
Show child attributes
Show child attributes
The recipient's phone number in international format (e.g., +123476529999)
Was this page helpful?
⌘I