Communications
Preview signed email preferences
Validates the signed token and returns organization branding and effective email category choices. The token scopes the address and organization; no bearer session is needed. Does not change preferences.
POST
/
unsubscribe
/
preview
Preview signed email preferences
curl --request POST \
--url https://api.gratona.com/v1/unsubscribe/preview \
--header 'Content-Type: application/json' \
--data '
{
"token": "signed-link-token"
}
'import requests
url = "https://api.gratona.com/v1/unsubscribe/preview"
payload = { "token": "signed-link-token" }
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({token: 'signed-link-token'})
};
fetch('https://api.gratona.com/v1/unsubscribe/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.gratona.com/v1/unsubscribe/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([
'token' => 'signed-link-token'
]),
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.gratona.com/v1/unsubscribe/preview"
payload := strings.NewReader("{\n \"token\": \"signed-link-token\"\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.gratona.com/v1/unsubscribe/preview")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"signed-link-token\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/unsubscribe/preview")
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 \"token\": \"signed-link-token\"\n}"
response = http.request(request)
puts response.read_body{
"organization": {
"name": "Example",
"logo": "<string>"
},
"tokens": {
"accent": "#4f46e5",
"on_accent": "#ffffff",
"link": "#4f46e5"
},
"source_category_key": "marketing",
"legacy_link": true,
"email_categories": [
{
"key": "marketing",
"label": "Example",
"description": "Example",
"requires_disable_warning": true,
"enabled": true,
"events": {},
"partially_enabled": true,
"blocked_code": "category_opt_out",
"blocked_reason": "All donor email is turned off."
}
]
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Body
application/json
Validated request fields for this operation.
Token. Validation: required, string, max:4096.
Maximum string length:
4096Example:
"signed-link-token"
Response
Operation result.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
marketing, account_security, receipts_tax, payment_issues, sponsorship_updates, events_fundraising, messages, files_photos, other_updates, null Example:
"marketing"
True for a whole-email legacy signed link.
Example:
true
Show child attributes
Show child attributes
⌘I
Preview signed email preferences
curl --request POST \
--url https://api.gratona.com/v1/unsubscribe/preview \
--header 'Content-Type: application/json' \
--data '
{
"token": "signed-link-token"
}
'import requests
url = "https://api.gratona.com/v1/unsubscribe/preview"
payload = { "token": "signed-link-token" }
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({token: 'signed-link-token'})
};
fetch('https://api.gratona.com/v1/unsubscribe/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.gratona.com/v1/unsubscribe/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([
'token' => 'signed-link-token'
]),
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.gratona.com/v1/unsubscribe/preview"
payload := strings.NewReader("{\n \"token\": \"signed-link-token\"\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.gratona.com/v1/unsubscribe/preview")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"signed-link-token\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/unsubscribe/preview")
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 \"token\": \"signed-link-token\"\n}"
response = http.request(request)
puts response.read_body{
"organization": {
"name": "Example",
"logo": "<string>"
},
"tokens": {
"accent": "#4f46e5",
"on_accent": "#ffffff",
"link": "#4f46e5"
},
"source_category_key": "marketing",
"legacy_link": true,
"email_categories": [
{
"key": "marketing",
"label": "Example",
"description": "Example",
"requires_disable_warning": true,
"enabled": true,
"events": {},
"partially_enabled": true,
"blocked_code": "category_opt_out",
"blocked_reason": "All donor email is turned off."
}
]
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}