Create Whatsapp Template
curl --request POST \
--url https://api.talqing.com/v1/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"name": "<string>",
"buttons": [
{
"text": "<string>",
"type": "quick_reply"
}
],
"examples": {},
"footer": "<string>",
"header": {
"text": "<string>",
"type": "text"
}
}
'import requests
url = "https://api.talqing.com/v1/whatsapp/templates"
payload = {
"body": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"name": "<string>",
"buttons": [
{
"text": "<string>",
"type": "quick_reply"
}
],
"examples": {},
"footer": "<string>",
"header": {
"text": "<string>",
"type": "text"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('<string>'),
integration_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
language: '<string>',
name: '<string>',
buttons: [{text: '<string>', type: 'quick_reply'}],
examples: {},
footer: '<string>',
header: {text: '<string>', type: 'text'}
})
};
fetch('https://api.talqing.com/v1/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.talqing.com/v1/whatsapp/templates",
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([
'body' => '<string>',
'integration_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'language' => '<string>',
'name' => '<string>',
'buttons' => [
[
'text' => '<string>',
'type' => 'quick_reply'
]
],
'examples' => [
],
'footer' => '<string>',
'header' => [
'text' => '<string>',
'type' => 'text'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/whatsapp/templates"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"language\": \"<string>\",\n \"name\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"type\": \"quick_reply\"\n }\n ],\n \"examples\": {},\n \"footer\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.talqing.com/v1/whatsapp/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"language\": \"<string>\",\n \"name\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"type\": \"quick_reply\"\n }\n ],\n \"examples\": {},\n \"footer\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/whatsapp/templates")
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 \"body\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"language\": \"<string>\",\n \"name\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"type\": \"quick_reply\"\n }\n ],\n \"examples\": {},\n \"footer\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n}"
response = http.request(request)
puts response.read_body{
"body": "<string>",
"buttons": [
{
"code": "<string>",
"phone_number": "<string>",
"text": "<string>",
"ttl_minutes": 123,
"type": "url",
"url": "<string>"
}
],
"category": "marketing",
"created_at": "2023-11-07T05:31:56Z",
"examples": {},
"footer": "<string>",
"header": {
"text": "<string>",
"type": "text",
"url": "<string>"
},
"id": "<string>",
"language": "<string>",
"name": "<string>",
"rejection_reason": "<string>",
"status": "pending",
"unsupported_reason": "<string>",
"variables": [
"<string>"
]
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}whatsapp
Create Whatsapp Template
Create a template, shared by every number on the Twilio account, and submit it to WhatsApp.
Review usually takes minutes; poll list_whatsapp_templates for status. Twilio only.
POST
/
v1
/
whatsapp
/
templates
Create Whatsapp Template
curl --request POST \
--url https://api.talqing.com/v1/whatsapp/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"body": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"name": "<string>",
"buttons": [
{
"text": "<string>",
"type": "quick_reply"
}
],
"examples": {},
"footer": "<string>",
"header": {
"text": "<string>",
"type": "text"
}
}
'import requests
url = "https://api.talqing.com/v1/whatsapp/templates"
payload = {
"body": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"name": "<string>",
"buttons": [
{
"text": "<string>",
"type": "quick_reply"
}
],
"examples": {},
"footer": "<string>",
"header": {
"text": "<string>",
"type": "text"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
body: JSON.stringify('<string>'),
integration_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
language: '<string>',
name: '<string>',
buttons: [{text: '<string>', type: 'quick_reply'}],
examples: {},
footer: '<string>',
header: {text: '<string>', type: 'text'}
})
};
fetch('https://api.talqing.com/v1/whatsapp/templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.talqing.com/v1/whatsapp/templates",
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([
'body' => '<string>',
'integration_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'language' => '<string>',
'name' => '<string>',
'buttons' => [
[
'text' => '<string>',
'type' => 'quick_reply'
]
],
'examples' => [
],
'footer' => '<string>',
'header' => [
'text' => '<string>',
'type' => 'text'
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/whatsapp/templates"
payload := strings.NewReader("{\n \"body\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"language\": \"<string>\",\n \"name\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"type\": \"quick_reply\"\n }\n ],\n \"examples\": {},\n \"footer\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.talqing.com/v1/whatsapp/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"body\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"language\": \"<string>\",\n \"name\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"type\": \"quick_reply\"\n }\n ],\n \"examples\": {},\n \"footer\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/whatsapp/templates")
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 \"body\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"language\": \"<string>\",\n \"name\": \"<string>\",\n \"buttons\": [\n {\n \"text\": \"<string>\",\n \"type\": \"quick_reply\"\n }\n ],\n \"examples\": {},\n \"footer\": \"<string>\",\n \"header\": {\n \"text\": \"<string>\",\n \"type\": \"text\"\n }\n}"
response = http.request(request)
puts response.read_body{
"body": "<string>",
"buttons": [
{
"code": "<string>",
"phone_number": "<string>",
"text": "<string>",
"ttl_minutes": 123,
"type": "url",
"url": "<string>"
}
],
"category": "marketing",
"created_at": "2023-11-07T05:31:56Z",
"examples": {},
"footer": "<string>",
"header": {
"text": "<string>",
"type": "text",
"url": "<string>"
},
"id": "<string>",
"language": "<string>",
"name": "<string>",
"rejection_reason": "<string>",
"status": "pending",
"unsupported_reason": "<string>",
"variables": [
"<string>"
]
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Authorizations
BearerAuthSessionCookie
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Variables are named: {{first_name}}.
Minimum string length:
1Available options:
marketing, utility A Twilio WhatsApp sender; the template is account-wide.
One of the catalog's whatsapp_template_languages.
Lowercase letters, digits and _.
buttons
(WhatsAppTemplateQuickReplyButtonInput · object | WhatsAppTemplateUrlButtonInput · object | WhatsAppTemplatePhoneButtonInput · object | WhatsAppTemplateVoiceCallButtonInput · object | WhatsAppTemplateCopyCodeButtonInput · object)[]
- WhatsAppTemplateQuickReplyButtonInput
- WhatsAppTemplateUrlButtonInput
- WhatsAppTemplatePhoneButtonInput
- WhatsAppTemplateVoiceCallButtonInput
- WhatsAppTemplateCopyCodeButtonInput
Show child attributes
Show child attributes
A realistic sample for every variable; WhatsApp reviews them.
Show child attributes
Show child attributes
Minimum string length:
1- WhatsAppTemplateTextHeaderInput
- WhatsAppTemplateMediaHeaderInput
Show child attributes
Show child attributes
Response
Successful Response
A template and where WhatsApp's review of it stands. Only approved can be sent.
Show child attributes
Show child attributes
Available options:
marketing, utility, authentication Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
pending, approved, rejected, paused, disabled