Trips
Queue a trip message
Requires access to trip messages under the authenticated organization and excludes sample trips. Saving a draft does not send it; phone and note channels create manual logs. Sending resolves active matching participants with email addresses and queues email or SMS delivery; SMS also requires at least one valid phone.
POST
/
admin
/
trips
/
{tripId}
/
messages
/
send
Queue a trip message
curl --request POST \
--url https://api.gratona.com/v1/admin/trips/{tripId}/messages/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"body": "Please review the updated trip details.",
"channel": "email",
"recipient_filter": {
"custom": [
123
],
"role": "leader",
"task_incomplete": 123,
"fundraising_below": 40
}
}
'import requests
url = "https://api.gratona.com/v1/admin/trips/{tripId}/messages/send"
payload = {
"subject": "<string>",
"body": "Please review the updated trip details.",
"channel": "email",
"recipient_filter": {
"custom": [123],
"role": "leader",
"task_incomplete": 123,
"fundraising_below": 40
}
}
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({
subject: '<string>',
body: JSON.stringify('Please review the updated trip details.'),
channel: 'email',
recipient_filter: {custom: [123], role: 'leader', task_incomplete: 123, fundraising_below: 40}
})
};
fetch('https://api.gratona.com/v1/admin/trips/{tripId}/messages/send', 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/admin/trips/{tripId}/messages/send",
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([
'subject' => '<string>',
'body' => 'Please review the updated trip details.',
'channel' => 'email',
'recipient_filter' => [
'custom' => [
123
],
'role' => 'leader',
'task_incomplete' => 123,
'fundraising_below' => 40
]
]),
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.gratona.com/v1/admin/trips/{tripId}/messages/send"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"body\": \"Please review the updated trip details.\",\n \"channel\": \"email\",\n \"recipient_filter\": {\n \"custom\": [\n 123\n ],\n \"role\": \"leader\",\n \"task_incomplete\": 123,\n \"fundraising_below\": 40\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))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/admin/trips/{tripId}/messages/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"body\": \"Please review the updated trip details.\",\n \"channel\": \"email\",\n \"recipient_filter\": {\n \"custom\": [\n 123\n ],\n \"role\": \"leader\",\n \"task_incomplete\": 123,\n \"fundraising_below\": 40\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/trips/{tripId}/messages/send")
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 \"subject\": \"<string>\",\n \"body\": \"Please review the updated trip details.\",\n \"channel\": \"email\",\n \"recipient_filter\": {\n \"custom\": [\n 123\n ],\n \"role\": \"leader\",\n \"task_incomplete\": 123,\n \"fundraising_below\": 40\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Saved successfully.",
"data": {
"id": 123,
"subject": "<string>",
"body": "<string>",
"channel": "<string>",
"entry_type": "<string>",
"status": "<string>",
"recipient_count": 123,
"sent_at": "2023-11-07T05:31:56Z",
"activity_at": "2023-11-07T05:31:56Z",
"replies_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"recipient_filter": {
"custom": [
123
],
"role": "leader",
"task_incomplete": 123,
"fundraising_below": 123
},
"sender": {
"id": 123,
"name": "<string>",
"email": "<string>"
},
"participants": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"role": "<string>",
"status": "<string>"
}
]
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Trip ID belonging to the authenticated organization.
Body
application/json
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Validation: required|string|max:255.
Maximum string length:
255Validation: required|string|max:50000.
Maximum string length:
50000Example:
"Please review the updated trip details."
Validation: nullable|in:email,sms.
Available options:
email, sms, null Example:
"email"
Show child attributes
Show child attributes
⌘I
Queue a trip message
curl --request POST \
--url https://api.gratona.com/v1/admin/trips/{tripId}/messages/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"body": "Please review the updated trip details.",
"channel": "email",
"recipient_filter": {
"custom": [
123
],
"role": "leader",
"task_incomplete": 123,
"fundraising_below": 40
}
}
'import requests
url = "https://api.gratona.com/v1/admin/trips/{tripId}/messages/send"
payload = {
"subject": "<string>",
"body": "Please review the updated trip details.",
"channel": "email",
"recipient_filter": {
"custom": [123],
"role": "leader",
"task_incomplete": 123,
"fundraising_below": 40
}
}
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({
subject: '<string>',
body: JSON.stringify('Please review the updated trip details.'),
channel: 'email',
recipient_filter: {custom: [123], role: 'leader', task_incomplete: 123, fundraising_below: 40}
})
};
fetch('https://api.gratona.com/v1/admin/trips/{tripId}/messages/send', 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/admin/trips/{tripId}/messages/send",
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([
'subject' => '<string>',
'body' => 'Please review the updated trip details.',
'channel' => 'email',
'recipient_filter' => [
'custom' => [
123
],
'role' => 'leader',
'task_incomplete' => 123,
'fundraising_below' => 40
]
]),
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.gratona.com/v1/admin/trips/{tripId}/messages/send"
payload := strings.NewReader("{\n \"subject\": \"<string>\",\n \"body\": \"Please review the updated trip details.\",\n \"channel\": \"email\",\n \"recipient_filter\": {\n \"custom\": [\n 123\n ],\n \"role\": \"leader\",\n \"task_incomplete\": 123,\n \"fundraising_below\": 40\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))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/admin/trips/{tripId}/messages/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"<string>\",\n \"body\": \"Please review the updated trip details.\",\n \"channel\": \"email\",\n \"recipient_filter\": {\n \"custom\": [\n 123\n ],\n \"role\": \"leader\",\n \"task_incomplete\": 123,\n \"fundraising_below\": 40\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/trips/{tripId}/messages/send")
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 \"subject\": \"<string>\",\n \"body\": \"Please review the updated trip details.\",\n \"channel\": \"email\",\n \"recipient_filter\": {\n \"custom\": [\n 123\n ],\n \"role\": \"leader\",\n \"task_incomplete\": 123,\n \"fundraising_below\": 40\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Saved successfully.",
"data": {
"id": 123,
"subject": "<string>",
"body": "<string>",
"channel": "<string>",
"entry_type": "<string>",
"status": "<string>",
"recipient_count": 123,
"sent_at": "2023-11-07T05:31:56Z",
"activity_at": "2023-11-07T05:31:56Z",
"replies_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"recipient_filter": {
"custom": [
123
],
"role": "leader",
"task_incomplete": 123,
"fundraising_below": 123
},
"sender": {
"id": 123,
"name": "<string>",
"email": "<string>"
},
"participants": [
{
"id": 123,
"name": "<string>",
"email": "<string>",
"role": "<string>",
"status": "<string>"
}
]
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}