Bloomerang¶
Overview¶
Bloomerang is a donor management platform for non-profits. This Parsons integration with the private Bloomerang REST API Documentation supports fetching, creating, and updating records of constituents, donations, and interactions.
Authentication
Authentication credentials can be created by Bloomerang database Administrator User. There are two authentication options for the private REST API, both of which are supported by Parsons:
Use a private API Key (less secure)
Use OAuth2 authentication, requiring a
client_idandclient_secret(more secure)
See the Bloomerang REST API Documentation for more information on API authentication.
Quickstart¶
To instantiate the Bloomerang class,
you can either store your Bloomerang private API key / OAuth2 credentialsas environmental variables
(BLOOMERANG_API_KEY for the private key approach
or BLOOMERANG_CLIENT_ID and BLOOMERANG_CLIENT_SECRET for the OAuth2 approach)
or pass in your API Key / OAuth2 credentials as arguments:
from parsons import Bloomerang
bloomerang = Bloomerang()
from parsons import Bloomerang
bloomerang = Bloomerang(api_key='my_key')
from parsons import Bloomerang
bloomerang = Bloomerang(client_id='my_client_id', client_secret='my_client_secret')
You can then call various endpoints:
bloomerang.create_constituent(email='john@email', first_name='John', last_name='Smith', city='Boston')
constituent = bloomerang.get_constituent(user_id='123')
bloomerang.update_constituent(user_id='123', city='New York')
bloomerang.delete_constituent(user_id='123')
API¶
- class parsons.bloomerang.bloomerang.Bloomerang(api_key=None, client_id=None, client_secret=None)[source]¶
Instantiate Bloomerang class
- Parameters:
api_key – str The Bloomerang API key. Not required if the
BLOOMERANG_API_KEYenvironmental variable is set or if the OAuth2 authentication parametersclient_idandclient_secretare set.client_id – str The Bloomerang client ID for OAuth2 authentication. Not required if the
BLOOMERANG_CLIENT_IDenv variable is set or if theapi_keyparameter is set. Note that theclient_secretparameter must also be set in order to use OAuth2 authentication.client_secret – str The Bloomerang client secret for OAuth2 authetication. Not required if the
BLOOMERANG_CLIENT_SECRETenv variable is set or if theapi_keyparameter is set. Note that theclient_idparameter must also be set in order to use OAuth2 authentication.
- create_constituent(**kwargs)[source]¶
- Parameters:
**kwargs –
Fields to include, e.g., FirstName = ‘Rachel’.
See the Bloomerang API docs for a full list of fields.
- update_constituent(constituent_id, **kwargs)[source]¶
- Parameters:
constituent_id – str or int Constituent ID to update
**kwargs –
Fields to update, e.g., FirstName = ‘RJ’.
See the Bloomerang API docs for a full list of fields.
- get_constituent(constituent_id)[source]¶
- Parameters:
constituent_id – str or int Constituent ID to get fields for
- Returns:
A JSON of the entry or an error.
- delete_constituent(constituent_id)[source]¶
- Parameters:
constituent_id – str or int Constituent ID to delete
- get_constituents(page_number=1, page_size=50, order_by=None, order_direction=None, last_modified=None)[source]¶
- Parameters:
page_number – int Number of the page to fetch
page_size – int Number of records per page (maximum allowed is 50)
order_by – str Sorts by
Id,CreatedDate, orLastModifiedDate(defaultId).order_direction – str Sorts the order_by in
AscorDescorder.last_modified – str Filters to constituents last modified after the specified date (ISO-8601 format).
- Returns:
A Table of the entries.
- create_transaction(**kwargs)[source]¶
- Parameters:
**kwargs –
Fields to include, e.g., CreditCardType = ‘Visa’.
See the Bloomerang API docs for a full list of fields.
- update_transaction(transaction_id, **kwargs)[source]¶
- Parameters:
transaction_id – str or int Transaction ID to update
**kwargs –
Fields to update, e.g., CreditCardType = ‘Visa’.
See the Bloomerang API docs for a full list of fields.
- get_transaction(transaction_id)[source]¶
- Parameters:
transaction_id – str or int Transaction ID to get fields for
- Returns:
A JSON of the entry or an error.
- delete_transaction(transaction_id)[source]¶
- Parameters:
transaction_id – str or int Transaction ID to delete
- get_transactions(page_number=1, page_size=50, order_by=None, order_direction=None)[source]¶
- Parameters:
page_number – int Number of the page to fetch
page_size – int Number of records per page (maximum allowed is 50)
order_by – str Sorts by
Date,CreatedDate, orLastModifiedDate(defaultDate).order_direction – str Sorts the order_by in
AscorDescorder (defaultDesc).
- Returns:
A JSON of the entry or an error.
- get_transaction_designation(designation_id)[source]¶
- Parameters:
designation_id – str or int Transaction Designation ID to get fields for
- Returns:
A JSON of the entry or an error.
- get_transaction_designations(page_number=1, page_size=50, order_by=None, order_direction=None)[source]¶
- Parameters:
page_number – int Number of the page to fetch
page_size – int Number of records per page (maximum allowed is 50)
order_by – str Sorts by
Date,CreatedDate, orLastModifiedDate(defaultDate).order_direction – str Sorts the order_by in
AscorDescorder (defaultDesc).
- Returns:
A JSON of the entry or an error.
- create_interaction(**kwargs)[source]¶
- Parameters:
**kwargs –
Fields to include, e.g., Channel = “Email”.
See the Bloomerang API docs for a full list of fields.
- update_interaction(interaction_id, **kwargs)[source]¶
- Parameters:
interaction_id – str or int Interaction ID to update
**kwargs –
Fields to update, e.g., EmailAddress = “user@example.com”.
See the Bloomerang API docs for a full list of fields.
- get_interaction(interaction_id)[source]¶
- Parameters:
interaction_id – str or int Interaction ID to get fields for
- Returns:
A JSON of the entry or an error.