Save Salesforce donation sync directions
A supplied source_of_truth determines directions: hys enables outbound, provider enables inbound, bidirectional enables both. When omitted, derives ownership from the two direction booleans; both omitted/false disable both directions. Supersedes prior donation mappings and returns mapping=null when disabled; otherwise approves the template-specific Opportunity or GiftTransaction mapping. This request does not import, charge or send a gift. Requires the integration platform global/configured client feature gate (normally integration_platform_foundation). Requires permission: one of access_account_settings.
curl --request POST \
--url https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"donation_outbound_enabled": true,
"donation_inbound_enabled": true,
"source_of_truth": "hys"
}
'import requests
url = "https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping"
payload = {
"donation_outbound_enabled": True,
"donation_inbound_enabled": True,
"source_of_truth": "hys"
}
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({
donation_outbound_enabled: true,
donation_inbound_enabled: true,
source_of_truth: 'hys'
})
};
fetch('https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping', 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/integrations/hub/connections/{connection_id}/salesforce/donation-mapping",
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([
'donation_outbound_enabled' => true,
'donation_inbound_enabled' => true,
'source_of_truth' => 'hys'
]),
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/integrations/hub/connections/{connection_id}/salesforce/donation-mapping"
payload := strings.NewReader("{\n \"donation_outbound_enabled\": true,\n \"donation_inbound_enabled\": true,\n \"source_of_truth\": \"hys\"\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/integrations/hub/connections/{connection_id}/salesforce/donation-mapping")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"donation_outbound_enabled\": true,\n \"donation_inbound_enabled\": true,\n \"source_of_truth\": \"hys\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping")
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 \"donation_outbound_enabled\": true,\n \"donation_inbound_enabled\": true,\n \"source_of_truth\": \"hys\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"connection": {
"id": 42,
"target_context_json": {
"donor_hysform_id": 42,
"recipient_program_id": 42,
"recipient_hysform_id": 42,
"donor_provider_object": "Example",
"donor_strategy": "Example",
"recipient_strategy": "Example",
"recipient_sync_direction": "Example",
"donation_provider_object": "Example",
"donation_strategy": "Example",
"donation_sync_direction": "Example",
"donation_opportunity_stage_name": "Example",
"recipient_inbound_enabled": true,
"interaction_sync_enabled": true,
"interaction_inbound_enabled": true,
"donation_outbound_enabled": true,
"donation_inbound_enabled": true,
"interaction_objects": [
"Task"
]
}
},
"mapping": {
"id": 42,
"connection_id": 42,
"provider_key": "salesforce_npsp",
"hys_object_type": "Example",
"provider_object_type": "Example",
"mapping_version": 2,
"status": "Example",
"source_of_truth_json": {},
"mapping_json": {},
"defaults_json": {},
"metadata_json": {},
"approved_at": "2023-11-07T05:31:56Z"
}
},
"message": "Example"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Connection id in the current organization.
Body
Validated request fields for this operation.
Donation outbound enabled. Validation: nullable, boolean.
true
Donation inbound enabled. Validation: nullable, boolean.
true
Source of truth. Validation: nullable; allowed values: hys, bidirectional, provider.
hys, bidirectional, provider, null "hys"
curl --request POST \
--url https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"donation_outbound_enabled": true,
"donation_inbound_enabled": true,
"source_of_truth": "hys"
}
'import requests
url = "https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping"
payload = {
"donation_outbound_enabled": True,
"donation_inbound_enabled": True,
"source_of_truth": "hys"
}
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({
donation_outbound_enabled: true,
donation_inbound_enabled: true,
source_of_truth: 'hys'
})
};
fetch('https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping', 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/integrations/hub/connections/{connection_id}/salesforce/donation-mapping",
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([
'donation_outbound_enabled' => true,
'donation_inbound_enabled' => true,
'source_of_truth' => 'hys'
]),
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/integrations/hub/connections/{connection_id}/salesforce/donation-mapping"
payload := strings.NewReader("{\n \"donation_outbound_enabled\": true,\n \"donation_inbound_enabled\": true,\n \"source_of_truth\": \"hys\"\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/integrations/hub/connections/{connection_id}/salesforce/donation-mapping")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"donation_outbound_enabled\": true,\n \"donation_inbound_enabled\": true,\n \"source_of_truth\": \"hys\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/integrations/hub/connections/{connection_id}/salesforce/donation-mapping")
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 \"donation_outbound_enabled\": true,\n \"donation_inbound_enabled\": true,\n \"source_of_truth\": \"hys\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"connection": {
"id": 42,
"target_context_json": {
"donor_hysform_id": 42,
"recipient_program_id": 42,
"recipient_hysform_id": 42,
"donor_provider_object": "Example",
"donor_strategy": "Example",
"recipient_strategy": "Example",
"recipient_sync_direction": "Example",
"donation_provider_object": "Example",
"donation_strategy": "Example",
"donation_sync_direction": "Example",
"donation_opportunity_stage_name": "Example",
"recipient_inbound_enabled": true,
"interaction_sync_enabled": true,
"interaction_inbound_enabled": true,
"donation_outbound_enabled": true,
"donation_inbound_enabled": true,
"interaction_objects": [
"Task"
]
}
},
"mapping": {
"id": 42,
"connection_id": 42,
"provider_key": "salesforce_npsp",
"hys_object_type": "Example",
"provider_object_type": "Example",
"mapping_version": 2,
"status": "Example",
"source_of_truth_json": {},
"mapping_json": {},
"defaults_json": {},
"metadata_json": {},
"approved_at": "2023-11-07T05:31:56Z"
}
},
"message": "Example"
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}