Bloomerang

Overview

Bloomerang is a donor management platform for non-profits. This Parsons integration with the private Bloomerang REST API supports fetching, creating, and updating records of constituents, donations, and interactions.

Note

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:

  1. Use a private API Key (less secure)

  2. Use OAuth2 authentication, requiring a client_id and client_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 credentials as environmental variables (BLOOMERANG_API_KEY for the private key approach, 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

# First approach: Use environmental variables
bloomerang = Bloomerang()

# Second approach: Pass private API key as argument
bloomerang = Bloomerang(api_key='my_key')

# Third approach: Pass OAuth2 client_id and client_secret as arguments
bloomerang = Bloomerang(client_id='my_client_id', client_secret='my_client_secret')

You can then call various endpoints:

# Create constituent
bloomerang.create_constituent(email='john@email', first_name='John', last_name='Smith', city='Boston')

# Get constituent
constituent = bloomerang.get_constituent(user_id='123')

# Update constituent
bloomerang.update_constituent(user_id='123', city='New York')

# Delete constituent
bloomerang.delete_constituent(user_id='123')

API

class parsons.Bloomerang(api_key=None, client_id=None, client_secret=None)[source]

Instantiate Bloomerang class

Args:
api_key: str

The Bloomerang API key. Not required if the BLOOMERANG_API_KEY environmental variable is set or if the OAuth2 authentication parameters client_id and client_secret are set.

client_id: str

The Bloomerang client ID for OAuth2 authentication. Not required if the BLOOMERANG_CLIENT_ID env variable is set or if the api_key parameter is set. Note that the client_secret parameter 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_SECRET env variable is set or if the api_key parameter is set. Note that the client_id parameter must also be set in order to use OAuth2 authentication.

create_constituent(**kwargs)[source]
Args:
**kwargs:`

Fields to include, e.g., FirstName = ‘Rachel’.

See the Bloomerang API docs for a full list of fields. # noqa

update_constituent(constituent_id, **kwargs)[source]
Args:
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. # noqa

get_constituent(constituent_id)[source]
Args:
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]
Args:
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]
Args:
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, or LastModifiedDate (default Id).

order_direction: str

Sorts the order_by in Asc or Desc order.

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]
Args:
**kwargs:`

Fields to include, e.g., CreditCardType = ‘Visa’.

See the Bloomerang API docs for a full list of fields. # noqa

update_transaction(transaction_id, **kwargs)[source]
Args:
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. # noqa

get_transaction(transaction_id)[source]
Args:
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]
Args:
transaction_id: str or int

Transaction ID to delete

get_transactions(page_number=1, page_size=50, order_by=None, order_direction=None)[source]
Args:
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, or LastModifiedDate (default Date).

order_direction: str

Sorts the order_by in Asc or Desc order (default Desc).

Returns:

A JSON of the entry or an error.

get_transaction_designation(designation_id)[source]
Args:
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]
Args:
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, or LastModifiedDate (default Date).

order_direction: str

Sorts the order_by in Asc or Desc order (default Desc).

Returns:

A JSON of the entry or an error.

create_interaction(**kwargs)[source]
Args:
**kwargs:`

Fields to include, e.g., Channel = “Email”.

See the Bloomerang API docs for a full list of fields. # noqa

update_interaction(interaction_id, **kwargs)[source]
Args:
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. # noqa

get_interaction(interaction_id)[source]
Args:
interaction_id: str or int

Interaction ID to get fields for

Returns:

A JSON of the entry or an error.

delete_interaction(interaction_id)[source]
Args:
interaction_id: str or int

Interaction ID to delete

get_interactions(page_number=1, page_size=50)[source]
Args:
page_number: int

Number of the page to fetch

page_size: int

Number of records per page (maximum allowed is 50)

Returns:

A JSON of the entry or an error.