Queue the import job for sponsorship relationships
curl --request POST \
--url https://api.gratona.com/v1/csv_process/{program_id}/relationships \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"original_filename": "<string>",
"csv_entity_field": "<string>",
"entity_field": "<string>",
"csv_donor_field": "<string>",
"donor_field": "<string>",
"csv_commitment_field": "<string>",
"csv_date_field": "<string>",
"csv_frequency_field": "<string>",
"csv_payment_method_field": "<string>",
"is_per_period_amount": true,
"import_inactive": true,
"csv_inactive_field": "<string>",
"offset": 123
}
'import requests
url = "https://api.gratona.com/v1/csv_process/{program_id}/relationships"
payload = {
"filename": "<string>",
"original_filename": "<string>",
"csv_entity_field": "<string>",
"entity_field": "<string>",
"csv_donor_field": "<string>",
"donor_field": "<string>",
"csv_commitment_field": "<string>",
"csv_date_field": "<string>",
"csv_frequency_field": "<string>",
"csv_payment_method_field": "<string>",
"is_per_period_amount": True,
"import_inactive": True,
"csv_inactive_field": "<string>",
"offset": 123
}
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({
filename: '<string>',
original_filename: '<string>',
csv_entity_field: '<string>',
entity_field: '<string>',
csv_donor_field: '<string>',
donor_field: '<string>',
csv_commitment_field: '<string>',
csv_date_field: '<string>',
csv_frequency_field: '<string>',
csv_payment_method_field: '<string>',
is_per_period_amount: true,
import_inactive: true,
csv_inactive_field: '<string>',
offset: 123
})
};
fetch('https://api.gratona.com/v1/csv_process/{program_id}/relationships', 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/csv_process/{program_id}/relationships",
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([
'filename' => '<string>',
'original_filename' => '<string>',
'csv_entity_field' => '<string>',
'entity_field' => '<string>',
'csv_donor_field' => '<string>',
'donor_field' => '<string>',
'csv_commitment_field' => '<string>',
'csv_date_field' => '<string>',
'csv_frequency_field' => '<string>',
'csv_payment_method_field' => '<string>',
'is_per_period_amount' => true,
'import_inactive' => true,
'csv_inactive_field' => '<string>',
'offset' => 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/csv_process/{program_id}/relationships"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"original_filename\": \"<string>\",\n \"csv_entity_field\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"csv_donor_field\": \"<string>\",\n \"donor_field\": \"<string>\",\n \"csv_commitment_field\": \"<string>\",\n \"csv_date_field\": \"<string>\",\n \"csv_frequency_field\": \"<string>\",\n \"csv_payment_method_field\": \"<string>\",\n \"is_per_period_amount\": true,\n \"import_inactive\": true,\n \"csv_inactive_field\": \"<string>\",\n \"offset\": 123\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/csv_process/{program_id}/relationships")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"original_filename\": \"<string>\",\n \"csv_entity_field\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"csv_donor_field\": \"<string>\",\n \"donor_field\": \"<string>\",\n \"csv_commitment_field\": \"<string>\",\n \"csv_date_field\": \"<string>\",\n \"csv_frequency_field\": \"<string>\",\n \"csv_payment_method_field\": \"<string>\",\n \"is_per_period_amount\": true,\n \"import_inactive\": true,\n \"csv_inactive_field\": \"<string>\",\n \"offset\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/csv_process/{program_id}/relationships")
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 \"filename\": \"<string>\",\n \"original_filename\": \"<string>\",\n \"csv_entity_field\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"csv_donor_field\": \"<string>\",\n \"donor_field\": \"<string>\",\n \"csv_commitment_field\": \"<string>\",\n \"csv_date_field\": \"<string>\",\n \"csv_frequency_field\": \"<string>\",\n \"csv_payment_method_field\": \"<string>\",\n \"is_per_period_amount\": true,\n \"import_inactive\": true,\n \"csv_inactive_field\": \"<string>\",\n \"offset\": 123\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
ID of the program
Body
S3 filename of the CSV
Original uploaded filename
Header name of the entity identifier column in CSV
Gratona entity field key used for matching
Header name of the donor identifier column in CSV
Gratona donor field key used for matching
Header name for commitment amount column
Header name for next payment date column
Header name for payment frequency column
Header name for payment method column
Whether the commitment amount is the charge per billing period. Omit to preserve existing commitments and default new commitments to monthly-base amounts.
Whether to process inactive statuses
Header name for inactive status column
Header row offset (default 0)
Response
Import queued successfully
curl --request POST \
--url https://api.gratona.com/v1/csv_process/{program_id}/relationships \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"original_filename": "<string>",
"csv_entity_field": "<string>",
"entity_field": "<string>",
"csv_donor_field": "<string>",
"donor_field": "<string>",
"csv_commitment_field": "<string>",
"csv_date_field": "<string>",
"csv_frequency_field": "<string>",
"csv_payment_method_field": "<string>",
"is_per_period_amount": true,
"import_inactive": true,
"csv_inactive_field": "<string>",
"offset": 123
}
'import requests
url = "https://api.gratona.com/v1/csv_process/{program_id}/relationships"
payload = {
"filename": "<string>",
"original_filename": "<string>",
"csv_entity_field": "<string>",
"entity_field": "<string>",
"csv_donor_field": "<string>",
"donor_field": "<string>",
"csv_commitment_field": "<string>",
"csv_date_field": "<string>",
"csv_frequency_field": "<string>",
"csv_payment_method_field": "<string>",
"is_per_period_amount": True,
"import_inactive": True,
"csv_inactive_field": "<string>",
"offset": 123
}
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({
filename: '<string>',
original_filename: '<string>',
csv_entity_field: '<string>',
entity_field: '<string>',
csv_donor_field: '<string>',
donor_field: '<string>',
csv_commitment_field: '<string>',
csv_date_field: '<string>',
csv_frequency_field: '<string>',
csv_payment_method_field: '<string>',
is_per_period_amount: true,
import_inactive: true,
csv_inactive_field: '<string>',
offset: 123
})
};
fetch('https://api.gratona.com/v1/csv_process/{program_id}/relationships', 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/csv_process/{program_id}/relationships",
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([
'filename' => '<string>',
'original_filename' => '<string>',
'csv_entity_field' => '<string>',
'entity_field' => '<string>',
'csv_donor_field' => '<string>',
'donor_field' => '<string>',
'csv_commitment_field' => '<string>',
'csv_date_field' => '<string>',
'csv_frequency_field' => '<string>',
'csv_payment_method_field' => '<string>',
'is_per_period_amount' => true,
'import_inactive' => true,
'csv_inactive_field' => '<string>',
'offset' => 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/csv_process/{program_id}/relationships"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"original_filename\": \"<string>\",\n \"csv_entity_field\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"csv_donor_field\": \"<string>\",\n \"donor_field\": \"<string>\",\n \"csv_commitment_field\": \"<string>\",\n \"csv_date_field\": \"<string>\",\n \"csv_frequency_field\": \"<string>\",\n \"csv_payment_method_field\": \"<string>\",\n \"is_per_period_amount\": true,\n \"import_inactive\": true,\n \"csv_inactive_field\": \"<string>\",\n \"offset\": 123\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/csv_process/{program_id}/relationships")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"original_filename\": \"<string>\",\n \"csv_entity_field\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"csv_donor_field\": \"<string>\",\n \"donor_field\": \"<string>\",\n \"csv_commitment_field\": \"<string>\",\n \"csv_date_field\": \"<string>\",\n \"csv_frequency_field\": \"<string>\",\n \"csv_payment_method_field\": \"<string>\",\n \"is_per_period_amount\": true,\n \"import_inactive\": true,\n \"csv_inactive_field\": \"<string>\",\n \"offset\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/csv_process/{program_id}/relationships")
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 \"filename\": \"<string>\",\n \"original_filename\": \"<string>\",\n \"csv_entity_field\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"csv_donor_field\": \"<string>\",\n \"donor_field\": \"<string>\",\n \"csv_commitment_field\": \"<string>\",\n \"csv_date_field\": \"<string>\",\n \"csv_frequency_field\": \"<string>\",\n \"csv_payment_method_field\": \"<string>\",\n \"is_per_period_amount\": true,\n \"import_inactive\": true,\n \"csv_inactive_field\": \"<string>\",\n \"offset\": 123\n}"
response = http.request(request)
puts response.read_body