Donor
The Donor object
The Donor object looks like this in JSON:
{
"object": "donor",
"id": 14,
"model_type": "person",
"model_id": 1747,
"assigned_to_id": null,
"status": "active",
"has_donations": true,
"import_id": null,
"added_at": "2020-02-11T17:29:44+00:00",
"added_by_id": 1257,
"sandbox": true
}
| Attribute | Required | Data Type |
|---|---|---|
| id | Yes | int |
| model_type | No | enum (person, contact_org) |
| model_id | No | int |
| assigned_to_id | No | int |
| status | Yes | enum (none, potential, active, inactive) |
| has_donations | Yes | bool |
| import_id | No | int |
| added_at | No | datetime |
| added_by_id | No | int |
| sandbox | No | bool |
index
Example code to call this method:
curl "https://yourschool.populiweb.com/api2/donors" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \
-X GET
-d '{
"filter": {"0":{"logic":"ALL","fields":[{"name":"num_donations","value":{"type":"RANGE","start":"1","end":"9"},"positive":1}]}}
}' \
require 'httparty'
response = HTTParty.get(
'https://yourschool.populiweb.com/api2/donors',
headers: {
'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
},
)
puts response.body
import requests
response = requests.get(
'https://yourschool.populiweb.com/api2/donors',
headers={
'Authorization': 'Bearer YOUR_POPULI_API_KEY'
},
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/donors"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/donors');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);
Example response:
{
"object": "list",
"count": 0,
"results": 0,
"results_per_page": 200,
"pages": 0,
"page": 0,
"offset": 0,
"has_more": false,
"data": [],
"sandbox": true
}
Retrieves all Donor objects that match given filter conditions.
HTTP Request
GET /donors
Parameters
| Name | Required | Data Type | Description |
|---|---|---|---|
| filter | No | mixed | See available filter conditions |
| page | No | int | The page of results to return if more than 200 records are found. |
Filter Condition Parameters
These conditions can be used to narrow the results returned.
| Name | Type |
|---|---|
| donation_posted_date | date |
| tax_year | year |
| name | text |
| address | address |
| text | |
| phone | text |
| model_type | choice |
| status | enum |
| is_deceased | bool |
| assigned_representative | object id |
| has_ever_donated | bool |
| largest_donation | decimal |
| num_donations | integer |
| num_soft_credits | integer |
| has_donation_from_campaign | object id |
| has_donation_from_appeal | object id |
| has_donation_to_fund | object id |
| donation_amount | decimal |
| soft_credit_amount | decimal |
| donation_amount_including_soft_credits | decimal |
| donation_posted_date_set_2 | date |
| num_donations_set_2 | integer |
| amount_set_2 | decimal |
| campaign_set_2 | object id |
| appeal_set_2 | object id |
| fund_set_2 | object id |
| set_amount_comparison | donors_amounts_comparison |
| tag | tag |
| custom_field | custom |
Permissions
One of the following roles is required to call this method:
- Financial Auditor
- Financial Admin
- Donations
show
Example code to call this method:
curl "https://yourschool.populiweb.com/api2/donors/(donor)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_POPULI_API_KEY" \
-X GET
require 'httparty'
response = HTTParty.get(
'https://yourschool.populiweb.com/api2/donors/(donor)',
headers: {
'Authorization' => 'Bearer YOUR_POPULI_API_KEY'
},
)
puts response.body
import requests
response = requests.get(
'https://yourschool.populiweb.com/api2/donors/(donor)',
headers={
'Authorization': 'Bearer YOUR_POPULI_API_KEY'
},
)
print(response.json())
using Newtonsoft.Json;
using RestSharp;
var client = new RestClient();
var request = new RestRequest(new Uri("https://yourschool.populiweb.com/api2/donors/(donor)"), Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_POPULI_API_KEY");
var response = client.Execute(request);
var response_object = JsonConvert.DeserializeObject(response.Content);
Console.Write(response_object);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://yourschool.populiweb.com/api2/donors/(donor)');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_POPULI_API_KEY']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
$response = curl_exec($curl);
$response_decoded = json_decode($response);
var_dump($response_decoded);
Example response:
{
"object": "donor",
"id": 14,
"model_type": "person",
"model_id": 1747,
"assigned_to_id": null,
"status": "active",
"has_donations": true,
"import_id": null,
"added_at": "2020-02-11T17:29:44+00:00",
"added_by_id": 1257,
"sandbox": true
}
Retrieves a specific Donor object.
HTTP Request
GET /donors/(donor)
Parameters
No additional parameters are needed beyond the ID of the object being requested that appears in the URL.
Expandable Properties
- donations
- donation_soft_credits
- donor_soft_credits
Permissions
One of the following roles is required to call this method:
- Financial Auditor
- Financial Admin
- Donations