TEMPLATES
Fetch Template content for a Channel
API to fetch content of a particular channel in a template group (live & draft versions).
GET
/
v1
/
template
/
{template_slug}
/
channel
/
{channel_slug}
/
Fetch Template content for a channel
curl --request GET \
--url https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/', 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://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/",
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: Bearer <token>"
],
]);
$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://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 1121,
"channel": {
"name": "In-App Inbox",
"slug": "inbox",
"is_template_approval_needed": false
},
"is_active": true,
"is_enabled": true,
"created_at": "2022-06-18T04:53:58.690274Z",
"updated_at": "2025-01-21T11:49:23.247217Z",
"disabled_languages": [],
"versions": [
{
"id": 69989,
"templates": [
{
"id": 74660,
"language": {
"name": "English",
"slug": "en"
},
"is_enabled": true,
"approval_status": "auto_approved",
"content": {
"...": null
},
"created_at": "2024-09-15T04:33:22.727005Z",
"updated_at": "2024-09-15T04:36:56.103368Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"approval_cycle": null,
"is_approval_needed": false,
"is_cloned_from_last_version": false
}
],
"status": "active",
"version_tag": "17",
"created_at": "2024-09-15T04:33:22.714274Z",
"updated_at": "2024-09-15T04:36:58.752580Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"version_tag_user": "v1",
"published_languages": [
"en"
],
"apparent_published_languages": [
"en"
],
"system_approval_info": {}
}
]
}{
"code": 404,
"type": "DoesNotExist",
"message": "TemplateGroup matching query does not exist."
}Legacy API. This is the older endpoint to fetch template content for a specific channel. We have released template 2.0 with variant support due to which the content structure and template APIs have changed. The new APIs are listed under Management API → Templates.This endpoint continues to return the live and draft content of templates created before 14 April 2026. Templates created on or after that date are only available through the new APIs.
Authorizations
Path Parameters
Response
200
⌘I
Fetch Template content for a channel
curl --request GET \
--url https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/', 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://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/",
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: Bearer <token>"
],
]);
$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://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hub.suprsend.com/v1/template/{template_slug}/channel/{channel_slug}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": 1121,
"channel": {
"name": "In-App Inbox",
"slug": "inbox",
"is_template_approval_needed": false
},
"is_active": true,
"is_enabled": true,
"created_at": "2022-06-18T04:53:58.690274Z",
"updated_at": "2025-01-21T11:49:23.247217Z",
"disabled_languages": [],
"versions": [
{
"id": 69989,
"templates": [
{
"id": 74660,
"language": {
"name": "English",
"slug": "en"
},
"is_enabled": true,
"approval_status": "auto_approved",
"content": {
"...": null
},
"created_at": "2024-09-15T04:33:22.727005Z",
"updated_at": "2024-09-15T04:36:56.103368Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"approval_cycle": null,
"is_approval_needed": false,
"is_cloned_from_last_version": false
}
],
"status": "active",
"version_tag": "17",
"created_at": "2024-09-15T04:33:22.714274Z",
"updated_at": "2024-09-15T04:36:58.752580Z",
"updated_by": {
"name": "Jane Doe",
"email": "user@example.com"
},
"version_tag_user": "v1",
"published_languages": [
"en"
],
"apparent_published_languages": [
"en"
],
"system_approval_info": {}
}
]
}{
"code": 404,
"type": "DoesNotExist",
"message": "TemplateGroup matching query does not exist."
}