cURL
curl --request PUT \
--url http://localhost:3001/api/admin/content/templates \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"workspaceId": "<string>",
"name": "<string>",
"id": "<string>",
"definition": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"draft": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"resourceType": "Declarative"
}
'import requests
url = "http://localhost:3001/api/admin/content/templates"
payload = {
"workspaceId": "<string>",
"name": "<string>",
"id": "<string>",
"definition": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"draft": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"resourceType": "Declarative"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workspaceId: '<string>',
name: '<string>',
id: '<string>',
definition: {
type: 'MobilePush',
title: '<string>',
body: JSON.stringify('<string>'),
imageUrl: '<string>'
},
draft: {
type: 'MobilePush',
title: '<string>',
body: JSON.stringify('<string>'),
imageUrl: '<string>'
},
resourceType: 'Declarative'
})
};
fetch('http://localhost:3001/api/admin/content/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_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/admin/content/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'workspaceId' => '<string>',
'name' => '<string>',
'id' => '<string>',
'definition' => [
'type' => 'MobilePush',
'title' => '<string>',
'body' => '<string>',
'imageUrl' => '<string>'
],
'draft' => [
'type' => 'MobilePush',
'title' => '<string>',
'body' => '<string>',
'imageUrl' => '<string>'
],
'resourceType' => 'Declarative'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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 := "http://localhost:3001/api/admin/content/templates"
payload := strings.NewReader("{\n \"workspaceId\": \"<string>\",\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"definition\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"draft\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"resourceType\": \"Declarative\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("http://localhost:3001/api/admin/content/templates")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"<string>\",\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"definition\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"draft\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"resourceType\": \"Declarative\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/admin/content/templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspaceId\": \"<string>\",\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"definition\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"draft\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"resourceType\": \"Declarative\"\n}"
response = http.request(request)
puts response.read_body{
"workspaceId": "<string>",
"id": "<string>",
"name": "<string>",
"type": "Email",
"updatedAt": 123,
"definition": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"android": {
"notification": {
"channelId": "<string>"
}
}
},
"draft": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"android": {
"notification": {
"channelId": "<string>"
}
}
}
}{
"type": "UniqueConstraintViolation",
"message": "<string>"
}API Reference
PUT /api/admin/content/templates
Create or update message template
PUT
/
api
/
admin
/
content
/
templates
cURL
curl --request PUT \
--url http://localhost:3001/api/admin/content/templates \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"workspaceId": "<string>",
"name": "<string>",
"id": "<string>",
"definition": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"draft": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"resourceType": "Declarative"
}
'import requests
url = "http://localhost:3001/api/admin/content/templates"
payload = {
"workspaceId": "<string>",
"name": "<string>",
"id": "<string>",
"definition": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"draft": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>"
},
"resourceType": "Declarative"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
workspaceId: '<string>',
name: '<string>',
id: '<string>',
definition: {
type: 'MobilePush',
title: '<string>',
body: JSON.stringify('<string>'),
imageUrl: '<string>'
},
draft: {
type: 'MobilePush',
title: '<string>',
body: JSON.stringify('<string>'),
imageUrl: '<string>'
},
resourceType: 'Declarative'
})
};
fetch('http://localhost:3001/api/admin/content/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_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/admin/content/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'workspaceId' => '<string>',
'name' => '<string>',
'id' => '<string>',
'definition' => [
'type' => 'MobilePush',
'title' => '<string>',
'body' => '<string>',
'imageUrl' => '<string>'
],
'draft' => [
'type' => 'MobilePush',
'title' => '<string>',
'body' => '<string>',
'imageUrl' => '<string>'
],
'resourceType' => 'Declarative'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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 := "http://localhost:3001/api/admin/content/templates"
payload := strings.NewReader("{\n \"workspaceId\": \"<string>\",\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"definition\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"draft\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"resourceType\": \"Declarative\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.put("http://localhost:3001/api/admin/content/templates")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspaceId\": \"<string>\",\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"definition\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"draft\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"resourceType\": \"Declarative\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/admin/content/templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspaceId\": \"<string>\",\n \"name\": \"<string>\",\n \"id\": \"<string>\",\n \"definition\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"draft\": {\n \"type\": \"MobilePush\",\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"imageUrl\": \"<string>\"\n },\n \"resourceType\": \"Declarative\"\n}"
response = http.request(request)
puts response.read_body{
"workspaceId": "<string>",
"id": "<string>",
"name": "<string>",
"type": "Email",
"updatedAt": 123,
"definition": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"android": {
"notification": {
"channelId": "<string>"
}
}
},
"draft": {
"type": "MobilePush",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"android": {
"notification": {
"channelId": "<string>"
}
}
}
}{
"type": "UniqueConstraintViolation",
"message": "<string>"
}Authorizations
Body
application/json
Mobile push template resource
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
Mobile push template resource
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
Available options:
Declarative Response
Default Response
type
Option 1 · enum<string>Option 2 · enum<string>Option 3 · enum<string>Option 4 · enum<string>
required
Available options:
Email Mobile push template resource
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
Mobile push template resource
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
⌘I

