bloomerang_api 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rubocop.yml +18 -0
- data/CHANGELOG.md +37 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +47 -0
- data/LICENSE.txt +21 -0
- data/README.md +204 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/bloomerang/address.rb +70 -0
- data/lib/bloomerang/appeal.rb +54 -0
- data/lib/bloomerang/base.rb +46 -0
- data/lib/bloomerang/campaign.rb +71 -0
- data/lib/bloomerang/configuration.rb +7 -0
- data/lib/bloomerang/constituent.rb +206 -0
- data/lib/bloomerang/custom_field.rb +56 -0
- data/lib/bloomerang/email.rb +64 -0
- data/lib/bloomerang/email_interest.rb +36 -0
- data/lib/bloomerang/fund.rb +55 -0
- data/lib/bloomerang/household.rb +94 -0
- data/lib/bloomerang/interaction.rb +82 -0
- data/lib/bloomerang/note.rb +65 -0
- data/lib/bloomerang/phone.rb +62 -0
- data/lib/bloomerang/pledge.rb +95 -0
- data/lib/bloomerang/refund.rb +64 -0
- data/lib/bloomerang/relationship.rb +80 -0
- data/lib/bloomerang/soft_credit.rb +64 -0
- data/lib/bloomerang/task.rb +88 -0
- data/lib/bloomerang/transaction.rb +113 -0
- data/lib/bloomerang/tribute.rb +66 -0
- data/lib/bloomerang/version.rb +5 -0
- data/lib/bloomerang.rb +40 -0
- data/lib/generators/bloomerang/USAGE +3 -0
- data/lib/generators/bloomerang/initializer/initializer_generator.rb +16 -0
- data/lib/generators/bloomerang/templates/bloomerang_config.rb +19 -0
- data/sig/bloomerang.rbs +4 -0
- metadata +97 -0
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Bloomerang
|
6
|
+
## Bloomerang::Campaign
|
7
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns
|
8
|
+
# Id integer($int64)
|
9
|
+
# Raised number($currency)
|
10
|
+
# The total amount raised for this campaign
|
11
|
+
|
12
|
+
# StartDate string($date) iso8601 format
|
13
|
+
# EndDate string($date) iso8601 format
|
14
|
+
# Goal number($currency)
|
15
|
+
# Name string
|
16
|
+
# SortIndex integer($int32)
|
17
|
+
# IsActive boolean
|
18
|
+
class Campaign < Base
|
19
|
+
### Fetch all campaigns
|
20
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/get_campaigns
|
21
|
+
#
|
22
|
+
## Params:
|
23
|
+
# skip integer, default: 0, simple paging system
|
24
|
+
# take integer, default: 50, simple paging system
|
25
|
+
# id array[integer], separated by pipes: "one|two|three"
|
26
|
+
# IsActive boolean
|
27
|
+
# search string, returns matches on any part of name
|
28
|
+
# hasGoal boolean, have either non-zero-dollar or zero-dollar goals
|
29
|
+
def fetch(params = {})
|
30
|
+
get("campaigns", params)
|
31
|
+
end
|
32
|
+
|
33
|
+
### Show single campaign
|
34
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/get_campaign__id_
|
35
|
+
#
|
36
|
+
# Params:
|
37
|
+
# id integer
|
38
|
+
def get(id)
|
39
|
+
get("campaign/#{id}")
|
40
|
+
end
|
41
|
+
|
42
|
+
### Update single campaign
|
43
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/put_campaign__id_
|
44
|
+
#
|
45
|
+
## Params:
|
46
|
+
# id integer
|
47
|
+
# body JSON object, see API for fields
|
48
|
+
def update(id, body)
|
49
|
+
put("campaign/#{id}", {}, body)
|
50
|
+
end
|
51
|
+
|
52
|
+
### Create single campaign
|
53
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/post_campaign
|
54
|
+
#
|
55
|
+
## Params:
|
56
|
+
# body JSON object, see API for fields
|
57
|
+
def create(body)
|
58
|
+
post("campaign", {}, body)
|
59
|
+
end
|
60
|
+
|
61
|
+
### Refresh summaries
|
62
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Campaigns/get_campaigns_refreshsummaries
|
63
|
+
# Refreshes campaign goals
|
64
|
+
# Returns: JSON: The list of campaigns that are active and have a non-zero goal.
|
65
|
+
#
|
66
|
+
## Params: none
|
67
|
+
def refresh_summaries
|
68
|
+
get("campaigns/refreshsummaries")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,206 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Bloomerang
|
6
|
+
### Bloomerang::Constituent
|
7
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents
|
8
|
+
# Id integer($int64), The ID of the constituent used in the API (not to be confused with AccountNumber)
|
9
|
+
# AccountNumber integer($int64), A user-friendly account number used in the Bloomerang CRM UI (not to be confused with ID).
|
10
|
+
# IsInHousehold boolean, Whether the Constituent is in a household
|
11
|
+
# IsHeadOfHousehold boolean, Whether the Constituent is in a household and is marked as the primary
|
12
|
+
# IsFavorite boolean, True if this constituent is a favorite of the current user
|
13
|
+
# FullCustomProfileImageId integer($int64), The ID of the existing file attachment for the full version of the custom profile image.
|
14
|
+
# FullCustomProfileImageUrl string($url), The URL of the existing file attachment for the full version of the custom profile image.
|
15
|
+
# CroppedCustomProfileImageId integer($int64), The ID of the existing file attachment for the cropped version of the custom profile image.
|
16
|
+
# CroppedCustomProfileImageUrl string($url), The URL of the existing file attachment for the cropped version of the custom profile image.
|
17
|
+
# Type ConstituentType: string, Enum: [ Individual, Organization ]
|
18
|
+
# Status AccountStatus: string, Enum: [ Active, Inactive, Deceased ]
|
19
|
+
# FirstName string
|
20
|
+
# LastName string
|
21
|
+
# MiddleName string
|
22
|
+
# Prefix string, Must match a prefix in the Bloomerang CRM
|
23
|
+
# Suffix string, Must match a suffix in the Bloomerang CRM
|
24
|
+
# FullName string
|
25
|
+
# InformalName string
|
26
|
+
# FormalName string
|
27
|
+
# EnvelopeName string
|
28
|
+
# RecognitionName string
|
29
|
+
# JobTitle string
|
30
|
+
# Employer string
|
31
|
+
# Website string($uri)
|
32
|
+
# FacebookId string
|
33
|
+
# TwitterId string
|
34
|
+
# LinkedInId string
|
35
|
+
# Gender Gender: string, Enum: [ Male, Female, Other ]
|
36
|
+
# Birthdate string($date)
|
37
|
+
# ProfilePictureType ProfilePictureType: string, Enum: [ None, Custom, Twitter ]
|
38
|
+
# PrimaryEmail Email (object)
|
39
|
+
# PrimaryPhone Phone (object)
|
40
|
+
# HouseholdId integer($int64), The ID of the household this constituent is in (not to be confused with AccountNumber)
|
41
|
+
# PreferredCommunicationChannel PreferredCommunicationChannel: string, Enum: [ Email, Phone, TextMessage, Mail ]
|
42
|
+
# CommunicationRestrictions array[string], Enum: [ DoNotCall, DoNotMail, DoNotSolicit ]
|
43
|
+
# CommunicationRestrictionsUpdateReason string, The most-recent reason for updating this constituent's communication restrictions
|
44
|
+
# EmailInterestType EmailInterestType: string, Enum: [ All, Custom, OptedOut ]
|
45
|
+
# CustomEmailInterests array[integer($int64)], IDs for custom email interests if the email interest type is Custom
|
46
|
+
# EmailInterestsUpdateReason string, The most-recent reason for updating this constituent's email interests
|
47
|
+
# PrimaryAddress Address (object)
|
48
|
+
# EngagementScore EngagementScore: string, Enum: [ Low, MediumLow, Medium, MediumHigh, High ]
|
49
|
+
# DonorSearchInfo DonorSearchInfo (object)
|
50
|
+
# AddressIds array[integer($int64)], The IDs of the addresses including the primary address ID
|
51
|
+
# EmailIds array[integer($int64)], The IDs of the emails including the primary email ID
|
52
|
+
# PhoneIds array[integer($int64)], The IDs of the phones including the primary phone ID
|
53
|
+
# CustomValues array[Objects], Objects are either OneValueAssignment or MultipleValueAssignments
|
54
|
+
# AuditTrail AuditTrail (Object)
|
55
|
+
class Constituent < Base
|
56
|
+
# for backwards compatability
|
57
|
+
|
58
|
+
### Fetch all constituents
|
59
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/get_constituents
|
60
|
+
#
|
61
|
+
# Params:
|
62
|
+
# skip integer, default: 0, simple paging system
|
63
|
+
# take integer, default: 50, simple paging system
|
64
|
+
# lastModified string, date in iso8601 format, Filters to constituents last modified after the specified date
|
65
|
+
# isFavorite boolean, Filters constituents to only constituents the user has favorited.
|
66
|
+
# type string, Available values : Individual, Organization
|
67
|
+
# id array[integer], separated by pipes: "1|2|3"
|
68
|
+
# orderBy string, Available values : Id (default), CreatedDate, LastModifiedDate
|
69
|
+
# orderDirection string, Available values : Asc, Desc
|
70
|
+
def fetch(params = {})
|
71
|
+
# TODO: BREAKING CHANGE: used to accept no arguments
|
72
|
+
get("constituents", params)
|
73
|
+
end
|
74
|
+
|
75
|
+
### Show a constituent
|
76
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/get_constituent__id_
|
77
|
+
#
|
78
|
+
# Params:
|
79
|
+
# id integer
|
80
|
+
def get(id)
|
81
|
+
get("constituent/#{id}")
|
82
|
+
end
|
83
|
+
|
84
|
+
### Show a constituent's relationships
|
85
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/get_constituent__id__relationships
|
86
|
+
#
|
87
|
+
# Params:
|
88
|
+
# skip integer, default: 0, simple paging system
|
89
|
+
# take integer, default: 50, simple paging system
|
90
|
+
# id integer
|
91
|
+
#
|
92
|
+
# Returns: array of Relationships
|
93
|
+
def fetch_relationships(id, params = {})
|
94
|
+
get("constituent/#{id}/relationships", params)
|
95
|
+
end
|
96
|
+
|
97
|
+
### Show a constituent's timeline
|
98
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/get_constituent__id__timeline
|
99
|
+
# Retrieves TimelineEntrySummary for the Constituent or all members of a Household (if Household ID is passed in)
|
100
|
+
#
|
101
|
+
# Params:
|
102
|
+
# skip integer, default: 0, simple paging system
|
103
|
+
# take integer, default: 50, simple paging system
|
104
|
+
# id integer
|
105
|
+
#
|
106
|
+
# Returns: paged list of TimelineEntrySummary models
|
107
|
+
def fetch_timeline(id, params = {})
|
108
|
+
get("constituent/#{id}/timeline", params)
|
109
|
+
end
|
110
|
+
|
111
|
+
### Update a constituent's communication settings
|
112
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/put_constituent__id__updateCommunicationSettings
|
113
|
+
#
|
114
|
+
# Params:
|
115
|
+
# id integer
|
116
|
+
# body see API for fields
|
117
|
+
def update_communication_settings(id, body)
|
118
|
+
put("/constituent/#{id}/updateCommunicationSettings", {}, body)
|
119
|
+
end
|
120
|
+
|
121
|
+
### Search for constituents and households
|
122
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/get_constituents_search
|
123
|
+
#
|
124
|
+
# Params:
|
125
|
+
# skip integer, default: 0, simple paging system
|
126
|
+
# take integer, default: 50, simple paging system
|
127
|
+
# search string, searches on Full Name with
|
128
|
+
def search(params = {})
|
129
|
+
get("constituents/search", params)
|
130
|
+
end
|
131
|
+
|
132
|
+
### Create or update a constituent
|
133
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/post_constituent_merge
|
134
|
+
#
|
135
|
+
# Params:
|
136
|
+
# body see API for fields
|
137
|
+
#
|
138
|
+
# NOTE: acts like upsert:
|
139
|
+
# "When merging, the database will look for a possible duplicate defined as a name
|
140
|
+
# plus one piece of contact info (address, email, or phone).
|
141
|
+
# If a duplicate is found, the data passed in will be merged into an existing constituent.
|
142
|
+
# If no duplicate is found, a new constituent will be created."
|
143
|
+
#
|
144
|
+
# there is a create-only endpoint, but
|
145
|
+
# given the risk of duplicate records, this should be the default method
|
146
|
+
# for create-only over merge-or-create
|
147
|
+
def create(body)
|
148
|
+
# "When merging, the database will look for a possible duplicate defined as a
|
149
|
+
# name plus one piece of contact info (address, email, or phone). If a duplicate
|
150
|
+
# is found, the data passed in will be merged into an existing constituent.
|
151
|
+
# If no duplicate is found, a new constituent will be created. Note that
|
152
|
+
# this endpoint does not accept SecondaryAddresses, SecondaryEmails, or
|
153
|
+
# SecondaryPhones and you will receive an exception if you pass those in.""
|
154
|
+
post("constituent/merge", {}, body)
|
155
|
+
end
|
156
|
+
|
157
|
+
### Create a constituent, including SecondaryEmail, SecondaryAddress and SecondaryPhone fields
|
158
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/post_constituent
|
159
|
+
#
|
160
|
+
# Params:
|
161
|
+
# body see API for fields
|
162
|
+
#
|
163
|
+
# NOTE: insert only, high risk of duplicates.
|
164
|
+
# The only benefit of this method over #create is the ability to specify
|
165
|
+
# secondary address, email and phone
|
166
|
+
#
|
167
|
+
# A more secure pattern would be to create the Constituent
|
168
|
+
# then use the returned Constituent ID to check for Emails, Addresses and Phones,
|
169
|
+
# and add records if necessary
|
170
|
+
def create_with_secondary(body)
|
171
|
+
post("constituent", {}, body)
|
172
|
+
end
|
173
|
+
|
174
|
+
### Update a constituent
|
175
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/put_constituent__id_
|
176
|
+
#
|
177
|
+
# Params:
|
178
|
+
# id integer
|
179
|
+
# body see API for fields
|
180
|
+
def update(id, body)
|
181
|
+
put("constituent/#{id}", {}, body)
|
182
|
+
end
|
183
|
+
|
184
|
+
### Search for duplicate constituents
|
185
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/post_constituent_duplicates
|
186
|
+
#
|
187
|
+
# Params:
|
188
|
+
# body see API for fields
|
189
|
+
#
|
190
|
+
# NOTE: There is a GET version as well,
|
191
|
+
# but POST was chosen for future Model usage
|
192
|
+
# e.g. body = Constituent.duplicate_check_attributes
|
193
|
+
def find_duplicates(body)
|
194
|
+
post("constituent/duplicates", {}, body)
|
195
|
+
end
|
196
|
+
|
197
|
+
### Delete a constituent
|
198
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/delete_constituent__id_
|
199
|
+
#
|
200
|
+
# Params:
|
201
|
+
# id integer
|
202
|
+
def delete(id)
|
203
|
+
delete("constituent/#{id}")
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Bloomerang
|
6
|
+
### Bloomerang::CustomField
|
7
|
+
# Id integer($int64)
|
8
|
+
# CategoryId integer($int64)
|
9
|
+
# Name string
|
10
|
+
# IsRequired boolean
|
11
|
+
# IsActive boolean
|
12
|
+
# DataType CustomFieldDataType (object): string, Enum: [ Currency, Date, Decimal, Text, Year ]
|
13
|
+
# PickType CustomFieldPickType (object): string, Enum: [ Freeform, PickMultiple, PickOne ]
|
14
|
+
# SortIndex integer($int32)
|
15
|
+
class CustomField
|
16
|
+
### Fetch CustomField Categories by type
|
17
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Custom%20Fields/get_customFieldCategories__type__
|
18
|
+
#
|
19
|
+
# Params:
|
20
|
+
# type string, Available values: Constituent, Transaction, Interaction, Note, Benevon
|
21
|
+
def categories(type)
|
22
|
+
get("/customFieldCategories/#{type}/")
|
23
|
+
end
|
24
|
+
|
25
|
+
### Fetch CustomFields by type
|
26
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Custom%20Fields/get_customFields__type__
|
27
|
+
#
|
28
|
+
# Params:
|
29
|
+
# type string, Available values: Constituent, Transaction, Interaction, Note, Benevon
|
30
|
+
# isActive boolean, Default value: true
|
31
|
+
def fields(type, params = {})
|
32
|
+
get("/customFields/#{type}/", params)
|
33
|
+
end
|
34
|
+
|
35
|
+
### Fetch CustomValues by type
|
36
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Custom%20Fields/get_customValues__type_
|
37
|
+
#
|
38
|
+
# Params:
|
39
|
+
# type string, Available values : Constituent, Transaction, Interaction, Note, Benevon
|
40
|
+
# isActive boolean, Default value: true
|
41
|
+
def values(type, params = {})
|
42
|
+
get("/customValues/#{type}/", params)
|
43
|
+
end
|
44
|
+
|
45
|
+
### Fetch CustomValues by type for the given field
|
46
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Custom%20Fields/get_customValues__type___fieldId_
|
47
|
+
#
|
48
|
+
# Params:
|
49
|
+
# type string, Available values : Constituent, Transaction, Interaction, Note, Benevon
|
50
|
+
# fieldId integer
|
51
|
+
# isActive boolean, Default value: true
|
52
|
+
def values_by_field(type, field_id, params = {})
|
53
|
+
get("/customValues/#{type}/#{field_id}", params)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Bloomerang
|
6
|
+
### Bloomerang::Email
|
7
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Addresses
|
8
|
+
# Id integer($int64)
|
9
|
+
# AccountId integer($int64), The ID of the constituent used in the API (not to be confused with accountNumber)
|
10
|
+
# Type EmailType string, Enum: [ Home, Work ]
|
11
|
+
# Value string($email), The email address
|
12
|
+
# IsPrimary boolean
|
13
|
+
# IsBad boolean
|
14
|
+
class Email < Base
|
15
|
+
### Fetch all emails
|
16
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Addresses/get_emails
|
17
|
+
#
|
18
|
+
# Params:
|
19
|
+
# skip integer, default: 0, simple paging system
|
20
|
+
# take integer, default: 50, simple paging system
|
21
|
+
# constituent array[integer], separated by pipes: "1|2|3"
|
22
|
+
# id array[integer], separated by pipes: "1|2|3"
|
23
|
+
def fetch(params = {})
|
24
|
+
get("emails", params)
|
25
|
+
end
|
26
|
+
|
27
|
+
### Fetch email by ID
|
28
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Addresses/get_email__id_
|
29
|
+
#
|
30
|
+
# Params:
|
31
|
+
# id integer
|
32
|
+
def get(id)
|
33
|
+
get("email/#{id}")
|
34
|
+
end
|
35
|
+
|
36
|
+
### Create email
|
37
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Addresses/post_email
|
38
|
+
#
|
39
|
+
# Params:
|
40
|
+
# body JSON object, see API for fields
|
41
|
+
def create(body)
|
42
|
+
post("email", {}, body)
|
43
|
+
end
|
44
|
+
|
45
|
+
### Update email
|
46
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Addresses/put_email__id_
|
47
|
+
#
|
48
|
+
# Params:
|
49
|
+
# id integer
|
50
|
+
# body JSON object, see API for fields
|
51
|
+
def update(id, body)
|
52
|
+
put("email/#{id}", {}, body)
|
53
|
+
end
|
54
|
+
|
55
|
+
### Delete email
|
56
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Addresses/delete_email__id_
|
57
|
+
#
|
58
|
+
# Params:
|
59
|
+
# id integer
|
60
|
+
def delete(id)
|
61
|
+
delete("email/#{id}")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Bloomerang
|
6
|
+
### Bloomerang:EmailInterest
|
7
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Interests
|
8
|
+
# Id integer($int64)
|
9
|
+
# IsSurveyEmailInterest boolean, Is this an email interest for Bloomerang donor surveys?
|
10
|
+
# SortIndex integer($int32)
|
11
|
+
# Name string
|
12
|
+
# IsDefault boolean
|
13
|
+
# IsActive boolean
|
14
|
+
class EmailInterest < Base
|
15
|
+
### Fetch all email interests
|
16
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Interests/get_emailInterests
|
17
|
+
#
|
18
|
+
# Params:
|
19
|
+
# skip integer, default: 0, simple paging system
|
20
|
+
# take integer, default: 50, simple paging system
|
21
|
+
# id array[integer], separated by pipes: "1|2|3"
|
22
|
+
# isActive boolean
|
23
|
+
def fetch(params = {})
|
24
|
+
get("emailInterests", params)
|
25
|
+
end
|
26
|
+
|
27
|
+
### Fetch an email interest by ID
|
28
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Email%20Interests/get_emailInterest__id_
|
29
|
+
#
|
30
|
+
# Params:
|
31
|
+
# id integer
|
32
|
+
def get(id)
|
33
|
+
get("emailInterest/#{id}")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bloomerang
|
4
|
+
### Bloomerang::Fund
|
5
|
+
# Id integer($int64)
|
6
|
+
# GeneralLedgerClass string, The class label for this fund in the general ledger (quickbooks)
|
7
|
+
# DefaultQuickbooksAccountId integer($int64), The ID of the general ledger (quickbooks) account to which this fund will default
|
8
|
+
# QuickbooksAccountIds array[integer], The IDs of all general ledger (quickbooks) accounts associated with this fund
|
9
|
+
# SortIndex integer($int32)
|
10
|
+
# Name string
|
11
|
+
# IsDefault boolean
|
12
|
+
# IsActive boolean
|
13
|
+
class Fund < Base
|
14
|
+
### Fetch all funds
|
15
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Funds/get_funds
|
16
|
+
#
|
17
|
+
# Params:
|
18
|
+
# skip integer, default: 0, simple paging system
|
19
|
+
# take integer, default: 50, simple paging system
|
20
|
+
# id array[integer], separated by pipes: "1|2|3"
|
21
|
+
# isActive boolean
|
22
|
+
# search string, Filters to funds with names that match any part of the search string
|
23
|
+
def fetch(params = {})
|
24
|
+
get("funds", params)
|
25
|
+
end
|
26
|
+
|
27
|
+
### Fetch fund by ID
|
28
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Funds/get_fund__id_
|
29
|
+
#
|
30
|
+
# Params:
|
31
|
+
# id integer
|
32
|
+
def get(id)
|
33
|
+
get("fund/#{id}")
|
34
|
+
end
|
35
|
+
|
36
|
+
### Create fund
|
37
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Funds/post_fund
|
38
|
+
#
|
39
|
+
# Params:
|
40
|
+
# body JSON object, see API for fields
|
41
|
+
def create(body)
|
42
|
+
post("fund", {}, body)
|
43
|
+
end
|
44
|
+
|
45
|
+
### Update a fund
|
46
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Funds/put_fund__id_
|
47
|
+
#
|
48
|
+
# Params:
|
49
|
+
# id integer
|
50
|
+
# body JSON object, see API for fields
|
51
|
+
def update(id, body)
|
52
|
+
put("fund/#{id}", {}, body)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bloomerang
|
4
|
+
### Bloomerang::Household
|
5
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Households
|
6
|
+
# FullName string
|
7
|
+
# SortName string
|
8
|
+
# InformalName string
|
9
|
+
# FormalName string
|
10
|
+
# EnvelopeName string
|
11
|
+
# RecognitionName string
|
12
|
+
# Id integer($int64), The ID of the household used in the API (not to be confused with AccountNumber)
|
13
|
+
# AccountNumber integer($int64), A user-friendly account number used in the Bloomerang CRM UI (not to be confused with ID).
|
14
|
+
# Type HouseholdType, string, Enum: [ Household ]
|
15
|
+
# Status AccountStatus, string, Enum: [ Active, Inactive, Deceased ]
|
16
|
+
# HeadId integer($int64), The ID of the head of household used in the API (not to be confused with AccountNumber)
|
17
|
+
# MemberIds [...] array[integer], The IDs of the members of the household used in the API, including the head of household's ID (not to be confused with AccountNumber)
|
18
|
+
# CommunicationRestrictions CommunicationRestriction, string, Enum: [ DoNotCall, DoNotMail, DoNotSolicit ]
|
19
|
+
# AuditTrail AuditTrail object
|
20
|
+
# IsFavorite boolean, True if this constituent is a favorite of the current user
|
21
|
+
# EngagementScore EngagementScore, string, Enum: [ Low, MediumLow, Medium, MediumHigh, High ]
|
22
|
+
class Household < Base
|
23
|
+
### Fetch all households
|
24
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Households/get_households
|
25
|
+
#
|
26
|
+
# Params:
|
27
|
+
# skip integer, default: 0, simple paging system
|
28
|
+
# take integer, default: 50, simple paging system
|
29
|
+
# lastModified string, date in iso8601 format, Filters to constituents last modified after the specified date
|
30
|
+
# id array[integer], separated by pipes: "1|2|3"
|
31
|
+
def fetch(params = {})
|
32
|
+
get("households", params)
|
33
|
+
end
|
34
|
+
|
35
|
+
### Fetch a household by ID
|
36
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Households/get_household__id_
|
37
|
+
#
|
38
|
+
# Params:
|
39
|
+
# id integer
|
40
|
+
def get(id)
|
41
|
+
get("household/#{id}")
|
42
|
+
end
|
43
|
+
|
44
|
+
### Search for constituents and households
|
45
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Constituents/get_constituents_search
|
46
|
+
#
|
47
|
+
# Params:
|
48
|
+
# skip integer, default: 0, simple paging system
|
49
|
+
# take integer, default: 50, simple paging system
|
50
|
+
# search string, searches on household name and constituent full name, matches any part of string
|
51
|
+
def search(params = {})
|
52
|
+
# TODO: BREAKING CHANGE: query changed to params
|
53
|
+
Constituent.search(params)
|
54
|
+
end
|
55
|
+
|
56
|
+
### Create a household
|
57
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Households/post_household
|
58
|
+
#
|
59
|
+
# Params:
|
60
|
+
# body JSON object, see API for fields
|
61
|
+
def create(body)
|
62
|
+
post("household", {}, body)
|
63
|
+
end
|
64
|
+
|
65
|
+
### Update a household
|
66
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Households/put_household__id_
|
67
|
+
#
|
68
|
+
# Params:
|
69
|
+
# id integer
|
70
|
+
# body JSON object, see API for fields
|
71
|
+
def update(id, body)
|
72
|
+
put("household/#{id}", {}, body)
|
73
|
+
end
|
74
|
+
|
75
|
+
### Delete a household
|
76
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Households/delete_household__id_
|
77
|
+
#
|
78
|
+
# Params:
|
79
|
+
# id integer
|
80
|
+
def delete(id)
|
81
|
+
delete("household/#{id}")
|
82
|
+
end
|
83
|
+
|
84
|
+
### Update household communication settings
|
85
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Households/put_household__id__updateCommunicationSettings
|
86
|
+
#
|
87
|
+
# Params:
|
88
|
+
# id integer
|
89
|
+
# body JSON object, see API for fields
|
90
|
+
def update_communication_settings(id, body)
|
91
|
+
put("household/#{id}/updateCommunicationSettings", {}, body)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "base"
|
4
|
+
|
5
|
+
module Bloomerang
|
6
|
+
### Bloomerang::Interaction
|
7
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions
|
8
|
+
# Id integer($int64)
|
9
|
+
# Date string($date), iso8601 format
|
10
|
+
# Note string
|
11
|
+
# Channel Channel object, string, Enum: [ Email, MassEmail, Phone, TextMessage, Mail, InPerson, SocialMedia, Website, Twitter, Other, EngagementSurveyEmail, EngagementSurvey ]
|
12
|
+
# Purpose Purpose, string, Enum: [ Acknowledgement, ImpactCultivation, Newsletter, Receipt, Solicitation, SpecialEvent, VolunteerActivity, PledgeReminder, Welcome, BenevonPointOfEntry, BenevonFollowUp, BenevonAskEvent, BenevonOneOnOneAsk, BenevonOngoingCultivation, Other ]
|
13
|
+
# Subject string
|
14
|
+
# IsInbound boolean
|
15
|
+
# AccountId integer($int64), The ID of the constituent used in the API (not to be confused with accountNumber)
|
16
|
+
# TweetId string, If the Channel is Twitter, this contains the ID of the tweet that can be used to display the tweet by substituting into https://twitter.com/anyUser/status/{TweetId}
|
17
|
+
# IsBcc boolean, Whether or not this interaction was created by an email that was sent to Bloomerang via BCC
|
18
|
+
# EmailAddress string($email), If the interaction is an email interaction, this is the email address of the constituent that received the email. Only populated when IsBcc is true.
|
19
|
+
# AttachmentIds array[integer], The ID of the attachments on this interaction
|
20
|
+
# LetterAttachmentIds array[integer], The ID of generated letter attachments on this interaction.
|
21
|
+
# SurveyLapsedResponses array[string], The list of reasons the donor lapsed, if this interaction represents a lapsed donor survey response
|
22
|
+
# IsEngagementSurveyResponse boolean, Whether this interaction represents a donor survey response
|
23
|
+
# SurveyEmailInteractionId integer($int64), The interaction ID of the survey email that was sent to the donor. Only populated when IsEngagementSurveyResponse is true
|
24
|
+
# IsEngagementSurveyEmail boolean, Whether this interaction represents a survey email that was sent to the donor
|
25
|
+
# SurveyResponseInteractionId integer($int64), The interaction ID of the survey response. Only populated when IsEngagementSurveyEmail is true.
|
26
|
+
# CustomValues array[object], oneOf -> [OneValueAssignment (object), MultipleValueAssignments (object)]
|
27
|
+
# AuditTrail AuditTrail (object)
|
28
|
+
class Interaction < Base
|
29
|
+
### Fetch all interactions
|
30
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions/get_interactions
|
31
|
+
#
|
32
|
+
# Params:
|
33
|
+
# skip integer, default: 0, simple paging system
|
34
|
+
# take integer, default: 50, simple paging system
|
35
|
+
# channel array[string], Available values : Email, MassEmail, Phone, TextMessage, Mail, InPerson, SocialMedia, Website, Twitter, Other, EngagementSurveyEmail, EngagementSurvey
|
36
|
+
# purpose array[string], Available values : Acknowledgement, ImpactCultivation, Newsletter, Receipt, Solicitation, SpecialEvent, VolunteerActivity, PledgeReminder, Welcome, BenevonPointOfEntry, BenevonFollowUp, BenevonAskEvent, BenevonOneOnOneAsk, BenevonOngoingCultivation, Other
|
37
|
+
# constituent array[integer], separated by pipes: "1|2|3"
|
38
|
+
# id array[integer], separated by pipes: "1|2|3"
|
39
|
+
# orderBy string, Available values : Id (default), CreatedDate, LastModifiedDate
|
40
|
+
# orderDirection string, Available values : Asc, Desc
|
41
|
+
def fetch(params = {})
|
42
|
+
get("interactions", params)
|
43
|
+
end
|
44
|
+
|
45
|
+
### Create an interaction
|
46
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions/post_interaction
|
47
|
+
#
|
48
|
+
# Params:
|
49
|
+
# body JSON object, see API for fields
|
50
|
+
def create(body)
|
51
|
+
post("interaction", {}, body)
|
52
|
+
end
|
53
|
+
|
54
|
+
### Fetch interaction by ID
|
55
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions/get_interaction__id_
|
56
|
+
#
|
57
|
+
# Params:
|
58
|
+
# id integer
|
59
|
+
def get(id)
|
60
|
+
get("interaction/#{id}")
|
61
|
+
end
|
62
|
+
|
63
|
+
### Update interaction
|
64
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions/put_interaction__id_
|
65
|
+
#
|
66
|
+
# Params:
|
67
|
+
# id integer
|
68
|
+
# body JSON object, see API for fields
|
69
|
+
def update(id, body)
|
70
|
+
put("interaction/#{id}", {}, body)
|
71
|
+
end
|
72
|
+
|
73
|
+
### Delete interaction
|
74
|
+
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Interactions/delete_interaction__id_
|
75
|
+
#
|
76
|
+
# Params:
|
77
|
+
# id integer
|
78
|
+
def delete(id)
|
79
|
+
delete("interaction/#{id}")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|