Email Calendar
Link an email interaction to a donor
Requires email/calendar deployment availability and the route permissions. Connected account operations use the authenticated tenant and mailbox owner; body/metadata sharing remains separately authorized. V2 requires current donor visibility and ownership of an eligible ingress copy, then promotes that copy through the current policy. Legacy email sets its donor and linked match metadata.
PATCH
/
interactions
/
email
/
{activity_id}
/
link
Link an email interaction to a donor
curl --request PATCH \
--url https://api.gratona.com/v1/interactions/email/{activity_id}/link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"donor_id": 123
}
'import requests
url = "https://api.gratona.com/v1/interactions/email/{activity_id}/link"
payload = { "donor_id": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({donor_id: 123})
};
fetch('https://api.gratona.com/v1/interactions/email/{activity_id}/link', 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/interactions/email/{activity_id}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'donor_id' => 123
]),
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/interactions/email/{activity_id}/link"
payload := strings.NewReader("{\n \"donor_id\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.gratona.com/v1/interactions/email/{activity_id}/link")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"donor_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/interactions/email/{activity_id}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"donor_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"local_body": "<string>",
"delivery_state": "<string>",
"legacy_action": "<string>",
"kind": "<string>",
"type": "<string>",
"client_id": 123,
"donor_id": 123,
"email_calendar_account_id": 123,
"account_email": "<string>",
"account_provider": "<string>",
"owner_user_id": 123,
"owner_name": "<string>",
"source": "<string>",
"subject": "<string>",
"from_address": "<string>",
"email_direction": "<string>",
"body_visibility": "<string>",
"match_status": "<string>",
"matched_by": "<string>",
"matched_email": "<string>",
"classification_class": "<string>",
"metadata_visibility": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"snippet": "<string>",
"provider_message_id": "<string>",
"provider_thread_id": "<string>",
"attachment_count": 123,
"subtype": "<string>",
"can_view_body": true,
"can_view_metadata": true,
"can_correct_relationship": true,
"source_deleted": true,
"provider_deleted_at": "2023-11-07T05:31:56Z",
"body_plain": "<string>",
"body_html": "<string>",
"body_fetch_status": "<string>",
"id": 123,
"to_addresses": [
"<string>"
],
"cc_addresses": [
"<string>"
],
"classification_reasons": [
"<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"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Body
application/json
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
⌘I
Link an email interaction to a donor
curl --request PATCH \
--url https://api.gratona.com/v1/interactions/email/{activity_id}/link \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"donor_id": 123
}
'import requests
url = "https://api.gratona.com/v1/interactions/email/{activity_id}/link"
payload = { "donor_id": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({donor_id: 123})
};
fetch('https://api.gratona.com/v1/interactions/email/{activity_id}/link', 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/interactions/email/{activity_id}/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'donor_id' => 123
]),
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/interactions/email/{activity_id}/link"
payload := strings.NewReader("{\n \"donor_id\": 123\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.gratona.com/v1/interactions/email/{activity_id}/link")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"donor_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/interactions/email/{activity_id}/link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"donor_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"data": {
"local_body": "<string>",
"delivery_state": "<string>",
"legacy_action": "<string>",
"kind": "<string>",
"type": "<string>",
"client_id": 123,
"donor_id": 123,
"email_calendar_account_id": 123,
"account_email": "<string>",
"account_provider": "<string>",
"owner_user_id": 123,
"owner_name": "<string>",
"source": "<string>",
"subject": "<string>",
"from_address": "<string>",
"email_direction": "<string>",
"body_visibility": "<string>",
"match_status": "<string>",
"matched_by": "<string>",
"matched_email": "<string>",
"classification_class": "<string>",
"metadata_visibility": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"snippet": "<string>",
"provider_message_id": "<string>",
"provider_thread_id": "<string>",
"attachment_count": 123,
"subtype": "<string>",
"can_view_body": true,
"can_view_metadata": true,
"can_correct_relationship": true,
"source_deleted": true,
"provider_deleted_at": "2023-11-07T05:31:56Z",
"body_plain": "<string>",
"body_html": "<string>",
"body_fetch_status": "<string>",
"id": 123,
"to_addresses": [
"<string>"
],
"cc_addresses": [
"<string>"
],
"classification_reasons": [
"<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"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}