Create automation template
curl --request POST \
--url https://api.embedreach.com/partner/automation-templates \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"version": "<string>",
"contents": {
"name": "<string>",
"description": "<string>",
"triggerMetadata": {
"triggerType": "one_time",
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"shouldOverrideActiveAutomations": true
},
"actionData": [
{
"index": 123,
"type": "send_communication",
"html": "<string>",
"css": "<string>",
"compiledHtml": "<string>",
"text": "<string>",
"subject": "<string>",
"previewText": "<string>",
"templateActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraMergeFields": [
{
"id": "<string>",
"type": "static",
"templateName": "<string>",
"displayName": "<string>",
"staticValue": "<string>"
}
],
"formTemplateKeys": [
"<string>"
],
"customBlockText": "<string>"
}
],
"includeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": [
"<string>"
],
"type": "property",
"description": "<string>"
}
]
}
],
"excludeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": [
"<string>"
],
"type": "property",
"description": "<string>"
}
]
}
],
"priority": 123,
"usePointOfContactSender": true,
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'import requests
url = "https://api.embedreach.com/partner/automation-templates"
payload = {
"name": "<string>",
"version": "<string>",
"contents": {
"name": "<string>",
"description": "<string>",
"triggerMetadata": {
"triggerType": "one_time",
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"shouldOverrideActiveAutomations": True
},
"actionData": [
{
"index": 123,
"type": "send_communication",
"html": "<string>",
"css": "<string>",
"compiledHtml": "<string>",
"text": "<string>",
"subject": "<string>",
"previewText": "<string>",
"templateActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraMergeFields": [
{
"id": "<string>",
"type": "static",
"templateName": "<string>",
"displayName": "<string>",
"staticValue": "<string>"
}
],
"formTemplateKeys": ["<string>"],
"customBlockText": "<string>"
}
],
"includeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": ["<string>"],
"type": "property",
"description": "<string>"
}
]
}
],
"excludeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": ["<string>"],
"type": "property",
"description": "<string>"
}
]
}
],
"priority": 123,
"usePointOfContactSender": True,
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
version: '<string>',
contents: {
name: '<string>',
description: '<string>',
triggerMetadata: {
triggerType: 'one_time',
scheduledAt: '2023-11-07T05:31:56Z',
timezone: '<string>',
shouldOverrideActiveAutomations: true
},
actionData: [
{
index: 123,
type: 'send_communication',
html: '<string>',
css: '<string>',
compiledHtml: '<string>',
text: '<string>',
subject: '<string>',
previewText: '<string>',
templateActionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
extraMergeFields: [
{
id: '<string>',
type: 'static',
templateName: '<string>',
displayName: '<string>',
staticValue: '<string>'
}
],
formTemplateKeys: ['<string>'],
customBlockText: '<string>'
}
],
includeSegmentDefaults: [
{
id: '<string>',
name: '<string>',
description: '<string>',
conditions: [{value: ['<string>'], type: 'property', description: '<string>'}]
}
],
excludeSegmentDefaults: [
{
id: '<string>',
name: '<string>',
description: '<string>',
conditions: [{value: ['<string>'], type: 'property', description: '<string>'}]
}
],
priority: 123,
usePointOfContactSender: true,
senderProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
})
};
fetch('https://api.embedreach.com/partner/automation-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.embedreach.com/partner/automation-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([
'name' => '<string>',
'version' => '<string>',
'contents' => [
'name' => '<string>',
'description' => '<string>',
'triggerMetadata' => [
'triggerType' => 'one_time',
'scheduledAt' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'shouldOverrideActiveAutomations' => true
],
'actionData' => [
[
'index' => 123,
'type' => 'send_communication',
'html' => '<string>',
'css' => '<string>',
'compiledHtml' => '<string>',
'text' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'templateActionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'extraMergeFields' => [
[
'id' => '<string>',
'type' => 'static',
'templateName' => '<string>',
'displayName' => '<string>',
'staticValue' => '<string>'
]
],
'formTemplateKeys' => [
'<string>'
],
'customBlockText' => '<string>'
]
],
'includeSegmentDefaults' => [
[
'id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'conditions' => [
[
'value' => [
'<string>'
],
'type' => 'property',
'description' => '<string>'
]
]
]
],
'excludeSegmentDefaults' => [
[
'id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'conditions' => [
[
'value' => [
'<string>'
],
'type' => 'property',
'description' => '<string>'
]
]
]
],
'priority' => 123,
'usePointOfContactSender' => true,
'senderProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"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.embedreach.com/partner/automation-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"contents\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"triggerMetadata\": {\n \"triggerType\": \"one_time\",\n \"scheduledAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"shouldOverrideActiveAutomations\": true\n },\n \"actionData\": [\n {\n \"index\": 123,\n \"type\": \"send_communication\",\n \"html\": \"<string>\",\n \"css\": \"<string>\",\n \"compiledHtml\": \"<string>\",\n \"text\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"templateActionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"extraMergeFields\": [\n {\n \"id\": \"<string>\",\n \"type\": \"static\",\n \"templateName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"staticValue\": \"<string>\"\n }\n ],\n \"formTemplateKeys\": [\n \"<string>\"\n ],\n \"customBlockText\": \"<string>\"\n }\n ],\n \"includeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"excludeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"priority\": 123,\n \"usePointOfContactSender\": true,\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.embedreach.com/partner/automation-templates")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"contents\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"triggerMetadata\": {\n \"triggerType\": \"one_time\",\n \"scheduledAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"shouldOverrideActiveAutomations\": true\n },\n \"actionData\": [\n {\n \"index\": 123,\n \"type\": \"send_communication\",\n \"html\": \"<string>\",\n \"css\": \"<string>\",\n \"compiledHtml\": \"<string>\",\n \"text\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"templateActionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"extraMergeFields\": [\n {\n \"id\": \"<string>\",\n \"type\": \"static\",\n \"templateName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"staticValue\": \"<string>\"\n }\n ],\n \"formTemplateKeys\": [\n \"<string>\"\n ],\n \"customBlockText\": \"<string>\"\n }\n ],\n \"includeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"excludeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"priority\": 123,\n \"usePointOfContactSender\": true,\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embedreach.com/partner/automation-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"contents\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"triggerMetadata\": {\n \"triggerType\": \"one_time\",\n \"scheduledAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"shouldOverrideActiveAutomations\": true\n },\n \"actionData\": [\n {\n \"index\": 123,\n \"type\": \"send_communication\",\n \"html\": \"<string>\",\n \"css\": \"<string>\",\n \"compiledHtml\": \"<string>\",\n \"text\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"templateActionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"extraMergeFields\": [\n {\n \"id\": \"<string>\",\n \"type\": \"static\",\n \"templateName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"staticValue\": \"<string>\"\n }\n ],\n \"formTemplateKeys\": [\n \"<string>\"\n ],\n \"customBlockText\": \"<string>\"\n }\n ],\n \"includeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"excludeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"priority\": 123,\n \"usePointOfContactSender\": true,\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"visibility": "visible",
"feature": "engage",
"featureSubType": "internal-review",
"contents": {
"name": "<string>",
"description": "<string>",
"triggerType": "one_time",
"triggerMetadata": {
"triggerType": "one_time",
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"shouldOverrideActiveAutomations": true
},
"actionData": [
{
"index": 123,
"type": "send_communication",
"html": "<string>",
"css": "<string>",
"compiledHtml": "<string>",
"text": "<string>",
"subject": "<string>",
"previewText": "<string>",
"templateActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraMergeFields": [
{
"id": "<string>",
"type": "static",
"templateName": "<string>",
"displayName": "<string>",
"staticValue": "<string>"
}
],
"formTemplateKeys": [
"<string>"
],
"customBlockText": "<string>",
"reputationTemplateType": "feedback-request"
}
],
"includeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"field": "userId",
"value": [
"<string>"
],
"operator": "equals",
"type": "property",
"description": "<string>"
}
]
}
],
"feature": "engage",
"excludeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"field": "userId",
"value": [
"<string>"
],
"operator": "equals",
"type": "property",
"description": "<string>"
}
]
}
],
"priority": 123,
"usePointOfContactSender": true,
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"tenants": {
"mode": "all",
"excludedTenantIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}{
"message": "<string>",
"success": false,
"errors": [
"<string>"
]
}Automation Templates
Create automation template
Create a new automation template for the authenticated partner
POST
/
partner
/
automation-templates
Create automation template
curl --request POST \
--url https://api.embedreach.com/partner/automation-templates \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"version": "<string>",
"contents": {
"name": "<string>",
"description": "<string>",
"triggerMetadata": {
"triggerType": "one_time",
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"shouldOverrideActiveAutomations": true
},
"actionData": [
{
"index": 123,
"type": "send_communication",
"html": "<string>",
"css": "<string>",
"compiledHtml": "<string>",
"text": "<string>",
"subject": "<string>",
"previewText": "<string>",
"templateActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraMergeFields": [
{
"id": "<string>",
"type": "static",
"templateName": "<string>",
"displayName": "<string>",
"staticValue": "<string>"
}
],
"formTemplateKeys": [
"<string>"
],
"customBlockText": "<string>"
}
],
"includeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": [
"<string>"
],
"type": "property",
"description": "<string>"
}
]
}
],
"excludeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": [
"<string>"
],
"type": "property",
"description": "<string>"
}
]
}
],
"priority": 123,
"usePointOfContactSender": true,
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'import requests
url = "https://api.embedreach.com/partner/automation-templates"
payload = {
"name": "<string>",
"version": "<string>",
"contents": {
"name": "<string>",
"description": "<string>",
"triggerMetadata": {
"triggerType": "one_time",
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"shouldOverrideActiveAutomations": True
},
"actionData": [
{
"index": 123,
"type": "send_communication",
"html": "<string>",
"css": "<string>",
"compiledHtml": "<string>",
"text": "<string>",
"subject": "<string>",
"previewText": "<string>",
"templateActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraMergeFields": [
{
"id": "<string>",
"type": "static",
"templateName": "<string>",
"displayName": "<string>",
"staticValue": "<string>"
}
],
"formTemplateKeys": ["<string>"],
"customBlockText": "<string>"
}
],
"includeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": ["<string>"],
"type": "property",
"description": "<string>"
}
]
}
],
"excludeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"value": ["<string>"],
"type": "property",
"description": "<string>"
}
]
}
],
"priority": 123,
"usePointOfContactSender": True,
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
version: '<string>',
contents: {
name: '<string>',
description: '<string>',
triggerMetadata: {
triggerType: 'one_time',
scheduledAt: '2023-11-07T05:31:56Z',
timezone: '<string>',
shouldOverrideActiveAutomations: true
},
actionData: [
{
index: 123,
type: 'send_communication',
html: '<string>',
css: '<string>',
compiledHtml: '<string>',
text: '<string>',
subject: '<string>',
previewText: '<string>',
templateActionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
extraMergeFields: [
{
id: '<string>',
type: 'static',
templateName: '<string>',
displayName: '<string>',
staticValue: '<string>'
}
],
formTemplateKeys: ['<string>'],
customBlockText: '<string>'
}
],
includeSegmentDefaults: [
{
id: '<string>',
name: '<string>',
description: '<string>',
conditions: [{value: ['<string>'], type: 'property', description: '<string>'}]
}
],
excludeSegmentDefaults: [
{
id: '<string>',
name: '<string>',
description: '<string>',
conditions: [{value: ['<string>'], type: 'property', description: '<string>'}]
}
],
priority: 123,
usePointOfContactSender: true,
senderProfileId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
})
};
fetch('https://api.embedreach.com/partner/automation-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.embedreach.com/partner/automation-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([
'name' => '<string>',
'version' => '<string>',
'contents' => [
'name' => '<string>',
'description' => '<string>',
'triggerMetadata' => [
'triggerType' => 'one_time',
'scheduledAt' => '2023-11-07T05:31:56Z',
'timezone' => '<string>',
'shouldOverrideActiveAutomations' => true
],
'actionData' => [
[
'index' => 123,
'type' => 'send_communication',
'html' => '<string>',
'css' => '<string>',
'compiledHtml' => '<string>',
'text' => '<string>',
'subject' => '<string>',
'previewText' => '<string>',
'templateActionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'extraMergeFields' => [
[
'id' => '<string>',
'type' => 'static',
'templateName' => '<string>',
'displayName' => '<string>',
'staticValue' => '<string>'
]
],
'formTemplateKeys' => [
'<string>'
],
'customBlockText' => '<string>'
]
],
'includeSegmentDefaults' => [
[
'id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'conditions' => [
[
'value' => [
'<string>'
],
'type' => 'property',
'description' => '<string>'
]
]
]
],
'excludeSegmentDefaults' => [
[
'id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'conditions' => [
[
'value' => [
'<string>'
],
'type' => 'property',
'description' => '<string>'
]
]
]
],
'priority' => 123,
'usePointOfContactSender' => true,
'senderProfileId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"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.embedreach.com/partner/automation-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"contents\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"triggerMetadata\": {\n \"triggerType\": \"one_time\",\n \"scheduledAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"shouldOverrideActiveAutomations\": true\n },\n \"actionData\": [\n {\n \"index\": 123,\n \"type\": \"send_communication\",\n \"html\": \"<string>\",\n \"css\": \"<string>\",\n \"compiledHtml\": \"<string>\",\n \"text\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"templateActionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"extraMergeFields\": [\n {\n \"id\": \"<string>\",\n \"type\": \"static\",\n \"templateName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"staticValue\": \"<string>\"\n }\n ],\n \"formTemplateKeys\": [\n \"<string>\"\n ],\n \"customBlockText\": \"<string>\"\n }\n ],\n \"includeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"excludeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"priority\": 123,\n \"usePointOfContactSender\": true,\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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.embedreach.com/partner/automation-templates")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"contents\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"triggerMetadata\": {\n \"triggerType\": \"one_time\",\n \"scheduledAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"shouldOverrideActiveAutomations\": true\n },\n \"actionData\": [\n {\n \"index\": 123,\n \"type\": \"send_communication\",\n \"html\": \"<string>\",\n \"css\": \"<string>\",\n \"compiledHtml\": \"<string>\",\n \"text\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"templateActionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"extraMergeFields\": [\n {\n \"id\": \"<string>\",\n \"type\": \"static\",\n \"templateName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"staticValue\": \"<string>\"\n }\n ],\n \"formTemplateKeys\": [\n \"<string>\"\n ],\n \"customBlockText\": \"<string>\"\n }\n ],\n \"includeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"excludeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"priority\": 123,\n \"usePointOfContactSender\": true,\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embedreach.com/partner/automation-templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"contents\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"triggerMetadata\": {\n \"triggerType\": \"one_time\",\n \"scheduledAt\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\n \"shouldOverrideActiveAutomations\": true\n },\n \"actionData\": [\n {\n \"index\": 123,\n \"type\": \"send_communication\",\n \"html\": \"<string>\",\n \"css\": \"<string>\",\n \"compiledHtml\": \"<string>\",\n \"text\": \"<string>\",\n \"subject\": \"<string>\",\n \"previewText\": \"<string>\",\n \"templateActionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"extraMergeFields\": [\n {\n \"id\": \"<string>\",\n \"type\": \"static\",\n \"templateName\": \"<string>\",\n \"displayName\": \"<string>\",\n \"staticValue\": \"<string>\"\n }\n ],\n \"formTemplateKeys\": [\n \"<string>\"\n ],\n \"customBlockText\": \"<string>\"\n }\n ],\n \"includeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"excludeSegmentDefaults\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"conditions\": [\n {\n \"value\": [\n \"<string>\"\n ],\n \"type\": \"property\",\n \"description\": \"<string>\"\n }\n ]\n }\n ],\n \"priority\": 123,\n \"usePointOfContactSender\": true,\n \"senderProfileId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"data": {
"template": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"visibility": "visible",
"feature": "engage",
"featureSubType": "internal-review",
"contents": {
"name": "<string>",
"description": "<string>",
"triggerType": "one_time",
"triggerMetadata": {
"triggerType": "one_time",
"scheduledAt": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"shouldOverrideActiveAutomations": true
},
"actionData": [
{
"index": 123,
"type": "send_communication",
"html": "<string>",
"css": "<string>",
"compiledHtml": "<string>",
"text": "<string>",
"subject": "<string>",
"previewText": "<string>",
"templateActionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"extraMergeFields": [
{
"id": "<string>",
"type": "static",
"templateName": "<string>",
"displayName": "<string>",
"staticValue": "<string>"
}
],
"formTemplateKeys": [
"<string>"
],
"customBlockText": "<string>",
"reputationTemplateType": "feedback-request"
}
],
"includeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"field": "userId",
"value": [
"<string>"
],
"operator": "equals",
"type": "property",
"description": "<string>"
}
]
}
],
"feature": "engage",
"excludeSegmentDefaults": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"conditions": [
{
"field": "userId",
"value": [
"<string>"
],
"operator": "equals",
"type": "property",
"description": "<string>"
}
]
}
],
"priority": 123,
"usePointOfContactSender": true,
"senderProfileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"tenants": {
"mode": "all",
"excludedTenantIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"createdAt": "<string>",
"updatedAt": "<string>"
}
}
}{
"message": "<string>",
"success": false,
"errors": [
"<string>"
]
}