Parsons

Integrations

  • ActBlue
  • ActionKit
  • Action Network
  • Airtable
  • Alchemer
  • Amazon Web Services
  • Azure: Blob Storage
  • Bill.com
  • Bloomerang
  • Bluelink
    • Overview
      • Quickstart
    • API
  • Box
  • Braintree
  • Civis
  • Controlshift
  • Copper
  • CrowdTangle
  • Databases
  • FacebookAds
  • Freshdesk
  • GitHub
  • Google
  • Hustle
  • Mailchimp
  • Mobilize America
  • New/Mode
  • NGPVAN
  • PDI
  • Phone2Action
  • Quickbase
  • Redash
  • Rock the Vote
  • Salesforce
  • SFTP
  • Shopify
  • Sisense
  • TargetSmart
  • TurboVote
  • Twilio
  • Zoom

Enhancements

  • US Census Geocoder

Framework

  • Database Sync
  • Parsons Table
  • Notifications
  • Utilities

Contributor Documentation

  • Contributing to Parsons
  • How to Build a Connector
  • How to Write Tests for Parsons Connectors

Use Cases and Sample Scripts

  • How to Contribute a Use Case & Sample Script
Parsons
  • »
  • Bluelink
  • View page source

Bluelink

Overview

Bluelink is an online tool for connecting the various digital software tools used by campaigns and movement groups in the political and non-profit space to allow you to seamlessly and easily sync data between them. This integration currently supports sending your structured person data and related tags to Bluelink via the Bluelink Webhook API, after which you can use our UI to send to any of our supported tools. If you don’t see a tool you would like to connect to, please reach out at hello@bluelink.org to ask us to add it.

Note

Authentication

If you don’t have a Bluelink account please complete the form on our website or email us at hello@bluelink.org. To get connection credentials select or ask an account administrator to select Bluelink Webhook from the apps menu. The credentials are automatically embedded into a one time secret link in case they need to be sent to you. Open the link to access the user and password, that you will then either pass directly to the Bluelink connector as arguments, or set them as environment variables.

Quickstart

To instantiate a class, you can either pass in the user and password token as arguments or set them in the BLUELINK_WEBHOOK_USER and BLUELINK_WEBHOOK_PASSWORD environment variables.

from parsons.bluelink import Bluelink

# First approach: Use API credentials via environmental variables
bluelink = Bluelink()

# Second approach: Pass API credentials as arguments
bluelink = Bluelink('username', 'password')

You can upsert person data by directly using a BluelinkPerson object:

from parsons.bluelink import Bluelink, BluelinkPerson, BluelinkIdentifier

# create the person object
person = BluelinkPerson(identifiers=[BluelinkIdentifier(source="SOURCE_VENDOR", identifier="ID")], given_name="Jane", family_name="Doe")

# use the bluelink connector to upsert
source = "MY_ORG_NAME"
bluelink.upsert_person(source, person)

You can bulk upsert person data via a Parsons Table by providing a function that takes a row and outputs a BluelinkPerson:

from parsons.bluelink import Bluelink, BluelinkPerson, BluelinkIdentifier

# a function that takes a row and returns a BluelinkPerson
def row_to_person(row):
   return BluelinkPerson(identifiers=[BluelinkIdentifier(source="SOURCE_VENDOR", identifier=row["id"])],
                 given_name=row["firstName"], family_name=row["lastName"])

# a parsons table filled with person data
parsons_tbl = get_data()

# call bulk_upsert_person
source = "MY_ORG_NAME"
bluelink.bulk_upsert_person(source, parsons_tbl, row_to_person)

API

class parsons.bluelink.Bluelink(user=None, password=None)[source]

Instantiate a Bluelink connector. Allows for a simple method of inserting person data to Bluelink via a webhook. # see: https://bluelinkdata.github.io/docs/BluelinkApiGuide#webhook

Args::
user: str

Bluelink webhook user name.

password: str

Bluelink webhook password.

upsert_person(source, person=None)[source]

Upsert a BluelinkPerson object into Bluelink. Rows will update, as opposed to being inserted, if an existing person record in Bluelink has a matching BluelinkIdentifier (same source and id) as the BluelinkPerson object passed into this function.

Args:
source: str

String to identify that the data came from your system. For example, your company name.

person: BluelinkPerson

A BluelinkPerson object. Will be inserted to Bluelink, or updated if a matching record is found.

Returns:

int An http status code from the http post request to the Bluelink webhook.

bulk_upsert_person(source, tbl, row_to_person)[source]

Upsert all rows into Bluelink, using the row_to_person function to transform rows to BluelinkPerson objects.

Args:
source: str

String to identify that the data came from your system. For example, your company name.

tbl: Table

A parsons Table that represents people data.

row_to_person: Callable[[dict],BluelinkPerson]

A function that takes a dict representation of a row from the passed in tbl and returns a BluelinkPerson object.

Returns:

list[int] A list of https response status codes, one response for each row in the table.

Previous Next

© Copyright 2019, The Movement Cooperative.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v0.18.1
Most Common
latest
stable
By Version Number
v0.14.0
v0.15.0
v0.16.0
v0.17.0
v0.18.0
v0.18.1