List message templates
curl --request GET \
--url https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates \
--header 'Authorization: <api-key>'import requests
url = "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/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.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"category": "UTILITY",
"components": "<unknown>",
"id": "1234567890123456",
"language": "en_US",
"name": "order_confirmation",
"status": "APPROVED"
}
],
"paging": {
"cursors": {
"after": "QVFIUjN...",
"before": "QVFIUjJ..."
},
"next": "https://graph.facebook.com/..."
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}WhatsApp
List message templates
Returns all message templates configured on the WhatsApp Business Account (WABA) associated with this connected account. Templates include approved, pending, rejected, and paused entries. Use the after cursor from paging.cursors to fetch subsequent pages.
GET
/
platforms
/
whatsapp
/
accounts
/
{id}
/
templates
List message templates
curl --request GET \
--url https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates \
--header 'Authorization: <api-key>'import requests
url = "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/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.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.social-api.ai/v1/platforms/whatsapp/accounts/{id}/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"category": "UTILITY",
"components": "<unknown>",
"id": "1234567890123456",
"language": "en_US",
"name": "order_confirmation",
"status": "APPROVED"
}
],
"paging": {
"cursors": {
"after": "QVFIUjN...",
"before": "QVFIUjJ..."
},
"next": "https://graph.facebook.com/..."
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Authorizations
Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...
Path Parameters
Connected account ID (sapi_acc_...)
Query Parameters
Maximum number of templates to return (1-100)
Pagination cursor (after) from a previous response
⌘I