Preview a draft notification rule without saving it
curl --request POST \
--url https://api.journeybee.io/v1/notification-rules/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"event_patterns": [
"<string>"
],
"schedule_config": {
"kind": "deal_expiration",
"days_before": 18250
},
"conditions": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"recipient_config": {
"role": "<string>",
"user_uuids": [
"<string>"
]
},
"channels": [],
"email_config": {
"header": "<string>",
"footer": "<string>",
"button_label": "<string>",
"show_branding": true
},
"title_template": "<string>",
"body_template": "<string>",
"sort_order": 1073741823,
"sample_after": {},
"sample_before": {}
}
'import requests
url = "https://api.journeybee.io/v1/notification-rules/preview"
payload = {
"name": "<string>",
"description": "<string>",
"event_patterns": ["<string>"],
"schedule_config": {
"kind": "deal_expiration",
"days_before": 18250
},
"conditions": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"recipient_config": {
"role": "<string>",
"user_uuids": ["<string>"]
},
"channels": [],
"email_config": {
"header": "<string>",
"footer": "<string>",
"button_label": "<string>",
"show_branding": True
},
"title_template": "<string>",
"body_template": "<string>",
"sort_order": 1073741823,
"sample_after": {},
"sample_before": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
event_patterns: ['<string>'],
schedule_config: {kind: 'deal_expiration', days_before: 18250},
conditions: [{field: '<string>', value: '<unknown>'}],
recipient_config: {role: '<string>', user_uuids: ['<string>']},
channels: [],
email_config: {
header: '<string>',
footer: '<string>',
button_label: '<string>',
show_branding: true
},
title_template: '<string>',
body_template: '<string>',
sort_order: 1073741823,
sample_after: {},
sample_before: {}
})
};
fetch('https://api.journeybee.io/v1/notification-rules/preview', 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.journeybee.io/v1/notification-rules/preview",
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>',
'description' => '<string>',
'event_patterns' => [
'<string>'
],
'schedule_config' => [
'kind' => 'deal_expiration',
'days_before' => 18250
],
'conditions' => [
[
'field' => '<string>',
'value' => '<unknown>'
]
],
'recipient_config' => [
'role' => '<string>',
'user_uuids' => [
'<string>'
]
],
'channels' => [
],
'email_config' => [
'header' => '<string>',
'footer' => '<string>',
'button_label' => '<string>',
'show_branding' => true
],
'title_template' => '<string>',
'body_template' => '<string>',
'sort_order' => 1073741823,
'sample_after' => [
],
'sample_before' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.journeybee.io/v1/notification-rules/preview"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"event_patterns\": [\n \"<string>\"\n ],\n \"schedule_config\": {\n \"kind\": \"deal_expiration\",\n \"days_before\": 18250\n },\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"recipient_config\": {\n \"role\": \"<string>\",\n \"user_uuids\": [\n \"<string>\"\n ]\n },\n \"channels\": [],\n \"email_config\": {\n \"header\": \"<string>\",\n \"footer\": \"<string>\",\n \"button_label\": \"<string>\",\n \"show_branding\": true\n },\n \"title_template\": \"<string>\",\n \"body_template\": \"<string>\",\n \"sort_order\": 1073741823,\n \"sample_after\": {},\n \"sample_before\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.journeybee.io/v1/notification-rules/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"event_patterns\": [\n \"<string>\"\n ],\n \"schedule_config\": {\n \"kind\": \"deal_expiration\",\n \"days_before\": 18250\n },\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"recipient_config\": {\n \"role\": \"<string>\",\n \"user_uuids\": [\n \"<string>\"\n ]\n },\n \"channels\": [],\n \"email_config\": {\n \"header\": \"<string>\",\n \"footer\": \"<string>\",\n \"button_label\": \"<string>\",\n \"show_branding\": true\n },\n \"title_template\": \"<string>\",\n \"body_template\": \"<string>\",\n \"sort_order\": 1073741823,\n \"sample_after\": {},\n \"sample_before\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.journeybee.io/v1/notification-rules/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"event_patterns\": [\n \"<string>\"\n ],\n \"schedule_config\": {\n \"kind\": \"deal_expiration\",\n \"days_before\": 18250\n },\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"recipient_config\": {\n \"role\": \"<string>\",\n \"user_uuids\": [\n \"<string>\"\n ]\n },\n \"channels\": [],\n \"email_config\": {\n \"header\": \"<string>\",\n \"footer\": \"<string>\",\n \"button_label\": \"<string>\",\n \"show_branding\": true\n },\n \"title_template\": \"<string>\",\n \"body_template\": \"<string>\",\n \"sort_order\": 1073741823,\n \"sample_after\": {},\n \"sample_before\": {}\n}"
response = http.request(request)
puts response.read_body{
"matched": true,
"title": "<string>",
"body": "<string>",
"recipients_summary": "<string>",
"email": {
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
}Notification Rules
Preview a draft notification rule without saving it
Renders the title, body and email against sample data and says who would be notified. Nothing is saved or sent.
POST
/
notification-rules
/
preview
Preview a draft notification rule without saving it
curl --request POST \
--url https://api.journeybee.io/v1/notification-rules/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"event_patterns": [
"<string>"
],
"schedule_config": {
"kind": "deal_expiration",
"days_before": 18250
},
"conditions": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"recipient_config": {
"role": "<string>",
"user_uuids": [
"<string>"
]
},
"channels": [],
"email_config": {
"header": "<string>",
"footer": "<string>",
"button_label": "<string>",
"show_branding": true
},
"title_template": "<string>",
"body_template": "<string>",
"sort_order": 1073741823,
"sample_after": {},
"sample_before": {}
}
'import requests
url = "https://api.journeybee.io/v1/notification-rules/preview"
payload = {
"name": "<string>",
"description": "<string>",
"event_patterns": ["<string>"],
"schedule_config": {
"kind": "deal_expiration",
"days_before": 18250
},
"conditions": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"recipient_config": {
"role": "<string>",
"user_uuids": ["<string>"]
},
"channels": [],
"email_config": {
"header": "<string>",
"footer": "<string>",
"button_label": "<string>",
"show_branding": True
},
"title_template": "<string>",
"body_template": "<string>",
"sort_order": 1073741823,
"sample_after": {},
"sample_before": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
event_patterns: ['<string>'],
schedule_config: {kind: 'deal_expiration', days_before: 18250},
conditions: [{field: '<string>', value: '<unknown>'}],
recipient_config: {role: '<string>', user_uuids: ['<string>']},
channels: [],
email_config: {
header: '<string>',
footer: '<string>',
button_label: '<string>',
show_branding: true
},
title_template: '<string>',
body_template: '<string>',
sort_order: 1073741823,
sample_after: {},
sample_before: {}
})
};
fetch('https://api.journeybee.io/v1/notification-rules/preview', 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.journeybee.io/v1/notification-rules/preview",
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>',
'description' => '<string>',
'event_patterns' => [
'<string>'
],
'schedule_config' => [
'kind' => 'deal_expiration',
'days_before' => 18250
],
'conditions' => [
[
'field' => '<string>',
'value' => '<unknown>'
]
],
'recipient_config' => [
'role' => '<string>',
'user_uuids' => [
'<string>'
]
],
'channels' => [
],
'email_config' => [
'header' => '<string>',
'footer' => '<string>',
'button_label' => '<string>',
'show_branding' => true
],
'title_template' => '<string>',
'body_template' => '<string>',
'sort_order' => 1073741823,
'sample_after' => [
],
'sample_before' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.journeybee.io/v1/notification-rules/preview"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"event_patterns\": [\n \"<string>\"\n ],\n \"schedule_config\": {\n \"kind\": \"deal_expiration\",\n \"days_before\": 18250\n },\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"recipient_config\": {\n \"role\": \"<string>\",\n \"user_uuids\": [\n \"<string>\"\n ]\n },\n \"channels\": [],\n \"email_config\": {\n \"header\": \"<string>\",\n \"footer\": \"<string>\",\n \"button_label\": \"<string>\",\n \"show_branding\": true\n },\n \"title_template\": \"<string>\",\n \"body_template\": \"<string>\",\n \"sort_order\": 1073741823,\n \"sample_after\": {},\n \"sample_before\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.journeybee.io/v1/notification-rules/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"event_patterns\": [\n \"<string>\"\n ],\n \"schedule_config\": {\n \"kind\": \"deal_expiration\",\n \"days_before\": 18250\n },\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"recipient_config\": {\n \"role\": \"<string>\",\n \"user_uuids\": [\n \"<string>\"\n ]\n },\n \"channels\": [],\n \"email_config\": {\n \"header\": \"<string>\",\n \"footer\": \"<string>\",\n \"button_label\": \"<string>\",\n \"show_branding\": true\n },\n \"title_template\": \"<string>\",\n \"body_template\": \"<string>\",\n \"sort_order\": 1073741823,\n \"sample_after\": {},\n \"sample_before\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.journeybee.io/v1/notification-rules/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"event_patterns\": [\n \"<string>\"\n ],\n \"schedule_config\": {\n \"kind\": \"deal_expiration\",\n \"days_before\": 18250\n },\n \"conditions\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"recipient_config\": {\n \"role\": \"<string>\",\n \"user_uuids\": [\n \"<string>\"\n ]\n },\n \"channels\": [],\n \"email_config\": {\n \"header\": \"<string>\",\n \"footer\": \"<string>\",\n \"button_label\": \"<string>\",\n \"show_branding\": true\n },\n \"title_template\": \"<string>\",\n \"body_template\": \"<string>\",\n \"sort_order\": 1073741823,\n \"sample_after\": {},\n \"sample_before\": {}\n}"
response = http.request(request)
puts response.read_body{
"matched": true,
"title": "<string>",
"body": "<string>",
"recipients_summary": "<string>",
"email": {
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}
}Authorizations
Body
application/json