Get a template
curl --request GET \
--url https://{notifuseDomain}/api/templates.get \
--header 'Authorization: Bearer <token>'import requests
url = "https://{notifuseDomain}/api/templates.get"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{notifuseDomain}/api/templates.get', 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://{notifuseDomain}/api/templates.get",
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://{notifuseDomain}/api/templates.get"
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://{notifuseDomain}/api/templates.get")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/templates.get")
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{
"template": {
"id": "welcome_email",
"name": "Welcome Email",
"channel": "email",
"category": "transactional",
"version": 1,
"email": {
"subject": "Welcome, {{user_name}}!",
"compiled_preview": "<string>",
"visual_editor_tree": {
"type": "mjml",
"children": []
},
"sender_id": "sender_123",
"reply_to": "support@example.com",
"subject_preview": "Get started with your account",
"text": "<string>"
},
"web": {
"content": {},
"html": "<string>",
"plain_text": "<string>"
},
"template_macro_id": "<string>",
"integration_id": "<string>",
"test_data": {
"user_name": "John Doe",
"action_url": "https://example.com/action"
},
"settings": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Template not found"
}{
"error": "<string>"
}Templates
Get a template
Retrieves a single template by ID. Optionally specify a version number to retrieve a specific version.
GET
/
api
/
templates.get
Get a template
curl --request GET \
--url https://{notifuseDomain}/api/templates.get \
--header 'Authorization: Bearer <token>'import requests
url = "https://{notifuseDomain}/api/templates.get"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{notifuseDomain}/api/templates.get', 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://{notifuseDomain}/api/templates.get",
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://{notifuseDomain}/api/templates.get"
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://{notifuseDomain}/api/templates.get")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/templates.get")
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{
"template": {
"id": "welcome_email",
"name": "Welcome Email",
"channel": "email",
"category": "transactional",
"version": 1,
"email": {
"subject": "Welcome, {{user_name}}!",
"compiled_preview": "<string>",
"visual_editor_tree": {
"type": "mjml",
"children": []
},
"sender_id": "sender_123",
"reply_to": "support@example.com",
"subject_preview": "Get started with your account",
"text": "<string>"
},
"web": {
"content": {},
"html": "<string>",
"plain_text": "<string>"
},
"template_macro_id": "<string>",
"integration_id": "<string>",
"test_data": {
"user_name": "John Doe",
"action_url": "https://example.com/action"
},
"settings": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Template not found"
}{
"error": "<string>"
}Authorizations
API token for authentication
Query Parameters
The ID of the workspace
The ID of the template
Specific version number (defaults to latest)
Response
Template retrieved successfully
Show child attributes
Show child attributes
⌘I
