curl --request POST \
--url https://api.voucher-staging.allride.io/partner/v1/email-templates:preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "redemption-link-otp",
"subject": {
"de": "Ihr Code: {{otpCode}}",
"en": "Your code: {{otpCode}}"
},
"htmlBody": {
"de": "<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>",
"en": "<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purpose: 'redemption-link-otp',
subject: {de: 'Ihr Code: {{otpCode}}', en: 'Your code: {{otpCode}}'},
htmlBody: {
de: '<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>',
en: '<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>'
}
})
};
fetch('https://api.voucher-staging.allride.io/partner/v1/email-templates:preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voucher-staging.allride.io/partner/v1/email-templates:preview"
payload = {
"purpose": "redemption-link-otp",
"subject": {
"de": "Ihr Code: {{otpCode}}",
"en": "Your code: {{otpCode}}"
},
"htmlBody": {
"de": "<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>",
"en": "<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.voucher-staging.allride.io/partner/v1/email-templates:preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"redemption-link-otp\",\n \"subject\": {\n \"de\": \"Ihr Code: {{otpCode}}\",\n \"en\": \"Your code: {{otpCode}}\"\n },\n \"htmlBody\": {\n \"de\": \"<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>\",\n \"en\": \"<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>\"\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/partner/v1/email-templates:preview"
payload := strings.NewReader("{\n \"purpose\": \"redemption-link-otp\",\n \"subject\": {\n \"de\": \"Ihr Code: {{otpCode}}\",\n \"en\": \"Your code: {{otpCode}}\"\n },\n \"htmlBody\": {\n \"de\": \"<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>\",\n \"en\": \"<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>\"\n }\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voucher-staging.allride.io/partner/v1/email-templates: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([
'purpose' => 'redemption-link-otp',
'subject' => [
'de' => 'Ihr Code: {{otpCode}}',
'en' => 'Your code: {{otpCode}}'
],
'htmlBody' => [
'de' => '<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>',
'en' => '<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>'
]
]),
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;
}Render an unsaved template preview
Renders and validates a template without saving it. See Email OTP links.
Required permissions: manage-consumer-email · API keys: allowed
curl --request POST \
--url https://api.voucher-staging.allride.io/partner/v1/email-templates:preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"purpose": "redemption-link-otp",
"subject": {
"de": "Ihr Code: {{otpCode}}",
"en": "Your code: {{otpCode}}"
},
"htmlBody": {
"de": "<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>",
"en": "<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purpose: 'redemption-link-otp',
subject: {de: 'Ihr Code: {{otpCode}}', en: 'Your code: {{otpCode}}'},
htmlBody: {
de: '<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>',
en: '<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>'
}
})
};
fetch('https://api.voucher-staging.allride.io/partner/v1/email-templates:preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.voucher-staging.allride.io/partner/v1/email-templates:preview"
payload = {
"purpose": "redemption-link-otp",
"subject": {
"de": "Ihr Code: {{otpCode}}",
"en": "Your code: {{otpCode}}"
},
"htmlBody": {
"de": "<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>",
"en": "<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://api.voucher-staging.allride.io/partner/v1/email-templates:preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"purpose\": \"redemption-link-otp\",\n \"subject\": {\n \"de\": \"Ihr Code: {{otpCode}}\",\n \"en\": \"Your code: {{otpCode}}\"\n },\n \"htmlBody\": {\n \"de\": \"<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>\",\n \"en\": \"<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>\"\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.voucher-staging.allride.io/partner/v1/email-templates:preview"
payload := strings.NewReader("{\n \"purpose\": \"redemption-link-otp\",\n \"subject\": {\n \"de\": \"Ihr Code: {{otpCode}}\",\n \"en\": \"Your code: {{otpCode}}\"\n },\n \"htmlBody\": {\n \"de\": \"<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>\",\n \"en\": \"<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>\"\n }\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voucher-staging.allride.io/partner/v1/email-templates: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([
'purpose' => 'redemption-link-otp',
'subject' => [
'de' => 'Ihr Code: {{otpCode}}',
'en' => 'Your code: {{otpCode}}'
],
'htmlBody' => [
'de' => '<!doctype html><html><body><p>Ihr Code: {{otpCode}}</p><p>Gültig für {{expiresInMinutes}} Minuten.</p></body></html>',
'en' => '<!doctype html><html><body><p>Your code: {{otpCode}}</p><p>Valid for {{expiresInMinutes}} minutes.</p></body></html>'
]
]),
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;
}Authorizations
Your API key in Authorization: Bearer <key>. Use vk_test_… keys against the sandbox and vk_live_… keys against production.
Headers
Optional key (1-255 printable ASCII characters, no spaces; a UUID is ideal) that makes this POST safe to retry: the same key with the same request replays the stored response for 24 hours. See Idempotency.
1 - 255^[\x21-\x7E]{1,255}$Body
An unsaved template to render.
Template purpose.
redemption-link-otp Subject per locale.
Show child attributes
Show child attributes
{ "de": "5 € Fahrguthaben", "en": "€5 ride credit" }
HTML per locale.
Show child attributes
Show child attributes
Text per locale.
Show child attributes
Show child attributes
Locale to render.
de, en Response
OK
Single-object envelope around a EmailTemplatePreview.
A template rendered with sample data (otpCode 123456, expiresInMinutes 10).
Show child attributes
Show child attributes