bloomerang_api 1.0.0 → 1.0.1
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 +4 -4
- data/.DS_Store +0 -0
- data/README.md +51 -53
- data/lib/bloomerang/custom_field.rb +1 -1
- data/lib/bloomerang/refund.rb +1 -1
- data/lib/bloomerang/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1115ff6cbfd710e29125b2f1dffd2c3a0406f650cab18e5188d92f64384469cf
|
4
|
+
data.tar.gz: 2329d69106766e001d2bd55376a040f5a0ccda7a3e3117f7e33b519c85bc6200
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6402efa8347325f403db5f3e9362533ccf0f522678599bff1642a28ef1786a0931f7fc7f6e332390d15b71b8dcca21bf6d645e41107c6ff1155cd8d2c4b12a58
|
7
|
+
data.tar.gz: 1423f68406509952f130961e78b0e70582d51bf77ada6541fe93a854536f3b3b9552a7ecb5cdba33c0b05a91cc96a083c6d1a0b2c016c69f11d93063eb690b9a
|
data/.DS_Store
ADDED
Binary file
|
data/README.md
CHANGED
@@ -7,15 +7,15 @@ _Note: you must be a Bloomerang customer with an active account to access the AP
|
|
7
7
|
|
8
8
|
This gem is based upon the initial work of [@allynfolksjr](https://github.com/allynfolksjr) at https://github.com/mcsweeneys/bloomerang. They added limited endpoint support for:
|
9
9
|
|
10
|
-
* Constituent
|
11
|
-
* Fund
|
12
|
-
* Transaction
|
10
|
+
* Constituent
|
11
|
+
* Fund
|
12
|
+
* Transaction
|
13
13
|
|
14
|
-
This gem adds support [
|
14
|
+
This gem adds support for [all other endpoints](https://github.com/chiperific/bloomerang_api/tree/main/lib/bloomerang), _except_:
|
15
15
|
|
16
|
-
* Processor
|
17
|
-
* User
|
18
|
-
* WalletItem
|
16
|
+
* Processor
|
17
|
+
* User
|
18
|
+
* WalletItem
|
19
19
|
|
20
20
|
|
21
21
|
## Installation for Ruby on Rails:
|
@@ -30,35 +30,34 @@ And then execute:
|
|
30
30
|
|
31
31
|
`$ bundle install`
|
32
32
|
|
33
|
-
Or install it yourself as:
|
34
|
-
|
35
|
-
`$ gem install bloomerang_api`
|
36
|
-
|
37
33
|
## Setup
|
38
34
|
|
39
35
|
1. Get your Bloomerang API Key:
|
40
36
|
|
41
|
-
- Generate your v2.0 API key from [your Bloomerang user settings](https://crm.bloomerang.co/Settings/User/Edit)
|
37
|
+
- Generate your v2.0 API key from [your Bloomerang user settings](https://crm.bloomerang.co/Settings/User/Edit)
|
42
38
|
|
43
39
|
2. Add your API key to your app using a secure method:
|
44
40
|
|
45
|
-
- [Credentials](https://edgeguides.rubyonrails.org/security.html#custom-credentials) strategy (preferred):
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
41
|
+
- [Credentials](https://edgeguides.rubyonrails.org/security.html#custom-credentials) strategy (preferred):
|
42
|
+
|
43
|
+
```yaml
|
44
|
+
# ./config/credentials.yml
|
45
|
+
bloomerang:
|
46
|
+
api_key: myapikey
|
47
|
+
```
|
48
|
+
|
49
|
+
- [dotenv](https://github.com/bkeepers/dotenv) strategy:
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
```
|
51
|
+
```ruby
|
52
|
+
# ./.env
|
53
|
+
BLOOMERANG_API_KEY=myapikey
|
54
|
+
```
|
57
55
|
|
58
|
-
- [ENV](https://blog.devgenius.io/what-are-environment-variables-in-rails-6f7e97a0b164) strategy:
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
- [ENV](https://blog.devgenius.io/what-are-environment-variables-in-rails-6f7e97a0b164) strategy:
|
57
|
+
|
58
|
+
```bash
|
59
|
+
$ export BLOOMERANG_API_KEY=myapikey
|
60
|
+
```
|
62
61
|
|
63
62
|
3. Run the generator to create the initializer file:
|
64
63
|
|
@@ -90,28 +89,32 @@ Bloomerang.configure do |config|
|
|
90
89
|
end
|
91
90
|
```
|
92
91
|
|
92
|
+
## Usage
|
93
|
+
|
94
|
+
:point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down::point_down:
|
95
|
+
|
93
96
|
### WARNING: NO SANDBOX, PRODUCTION ONLY
|
94
97
|
|
95
98
|
Bloomerang does not offer a sandbox environment or any way to test API calls without actually affecting your production data.
|
96
99
|
|
97
|
-
__Any POST, PUT and DELETE requests will be run against your live Bloomerang account!__
|
98
|
-
|
99
100
|
[Please encourage Bloomerang](https://crm.bloomerang.co/Home/FeaturesPortal) to address this issue.
|
100
101
|
|
101
|
-
|
102
|
+
***Any POST, PUT and DELETE requests will be run against your live Bloomerang account!***
|
103
|
+
|
104
|
+
:point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2::point_up_2:
|
102
105
|
|
103
|
-
|
106
|
+
### Standard structure:
|
104
107
|
|
105
108
|
- Reading records:
|
106
|
-
|
107
|
-
|
109
|
+
- `#fetch`: a GET request that returns a batch of records, 50 by default (see paging/batching below for more)
|
110
|
+
- `#show`: a GET request returns a single record that matches the provided ID
|
108
111
|
|
109
112
|
- Creating, updating and deleting records:
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
+
- `#create`: a POST request that creates a record based on the provided `body` variable.
|
114
|
+
- `#update`: a PUT request that updates a record
|
115
|
+
- `#delete`: a DELETE request that deletes a record
|
113
116
|
|
114
|
-
__It is highly recommended to reference the [documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api) to identify required and allowed attributes.__
|
117
|
+
__It is highly recommended to reference the [documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api) to identify required and allowed attributes.__
|
115
118
|
|
116
119
|
Some `Class`es have custom endpoints. For example:
|
117
120
|
|
@@ -121,12 +124,12 @@ Some `Class`es have custom endpoints. For example:
|
|
121
124
|
- `Bloomerang::Constituent.search`
|
122
125
|
- `Bloomerang::CustomField.categories`
|
123
126
|
|
124
|
-
|
127
|
+
Check [the specific class](https://github.com/chiperific/bloomerang_api/tree/main/lib/bloomerang) for available methods.
|
125
128
|
|
126
129
|
### GET requests:
|
127
|
-
Most
|
130
|
+
Most GET requests have URL parameters that can be set.
|
128
131
|
|
129
|
-
Each `Class`
|
132
|
+
[Each `Class`](https://github.com/chiperific/bloomerang_api/tree/main/lib/bloomerang) lists the available parameters you can append to `GET` requests, you can also check each endpoints' [documentation](https://bloomerang.co/product/integrations-data-management/api/rest-api).
|
130
133
|
|
131
134
|
#### Paging / Batching support:
|
132
135
|
|
@@ -146,12 +149,11 @@ The result will include these keys:
|
|
146
149
|
|
147
150
|
```json
|
148
151
|
{
|
149
|
-
"Total": 1850,
|
150
|
-
"TotalFiltered": 1850,
|
152
|
+
"Total": 1850, // All records in the database
|
153
|
+
"TotalFiltered": 1850, // All records that match query/filters
|
151
154
|
"Start": 0,
|
152
155
|
"ResultCount": 50,
|
153
|
-
"Results": [
|
154
|
-
{ ...
|
156
|
+
"Results": []
|
155
157
|
```
|
156
158
|
|
157
159
|
`"Start"` should be equal to `skip` and `"ResultCount` should be equal to `take`.
|
@@ -160,25 +162,21 @@ Increase your `skip` value by your `take` value to get the next page/batch of re
|
|
160
162
|
|
161
163
|
```ruby
|
162
164
|
params = { skip: 50, take: 50 }
|
163
|
-
|
165
|
+
next_fifty_constituents = Bloomerang::Constituent.fetch(params)
|
164
166
|
```
|
165
167
|
|
166
168
|
```json
|
167
169
|
{
|
168
|
-
"Total": 1850,
|
169
|
-
"TotalFiltered": 1850,
|
170
|
+
"Total": 1850, // All records in the database
|
171
|
+
"TotalFiltered": 1850, // All records that match query/filters
|
170
172
|
"Start": 50,
|
171
173
|
"ResultCount": 50,
|
172
|
-
"Results": [
|
173
|
-
{ ...
|
174
|
+
"Results": []
|
174
175
|
```
|
175
176
|
|
176
177
|
### POST/PUT/DELETE requests:
|
177
|
-
__WARNING: Bloomerang has no test/sandbox feature!__
|
178
|
-
|
179
|
-
Any POST, PUT and DELETE requests will be run against your live Bloomerang account!
|
180
178
|
|
181
|
-
|
179
|
+
***WARNING: Bloomerang has no test/sandbox feature! Any POST, PUT and DELETE requests will be run against your live Bloomerang account! Proceed with caution!***
|
182
180
|
|
183
181
|
|
184
182
|
`#update`, and `#delete` methods require a record ID and a `body` object. Not all `Class`es implement a `#delete` endpoint.
|
@@ -12,7 +12,7 @@ module Bloomerang
|
|
12
12
|
# DataType CustomFieldDataType (object): string, Enum: [ Currency, Date, Decimal, Text, Year ]
|
13
13
|
# PickType CustomFieldPickType (object): string, Enum: [ Freeform, PickMultiple, PickOne ]
|
14
14
|
# SortIndex integer($int32)
|
15
|
-
class CustomField
|
15
|
+
class CustomField < Base
|
16
16
|
### Fetch CustomField Categories by type
|
17
17
|
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Custom%20Fields/get_customFieldCategories__type__
|
18
18
|
#
|
data/lib/bloomerang/refund.rb
CHANGED
@@ -9,7 +9,7 @@ module Bloomerang
|
|
9
9
|
# Date string($date), iso8601 format
|
10
10
|
# Amount number($currency)
|
11
11
|
# AuditTrail AuditTrail (object)
|
12
|
-
class Refund
|
12
|
+
class Refund < Base
|
13
13
|
### Fetch all refunds
|
14
14
|
## https://bloomerang.co/product/integrations-data-management/api/rest-api/#/Refunds/get_refunds
|
15
15
|
#
|
data/lib/bloomerang/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bloomerang_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chiperific
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -31,6 +31,7 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
+
- ".DS_Store"
|
34
35
|
- ".rubocop.yml"
|
35
36
|
- CHANGELOG.md
|
36
37
|
- CODE_OF_CONDUCT.md
|