Hustle

Overview

Hustle is a peer to peer texting communication platform. This Parsons integration with the the Hustle v1 API provides methods for fetching agents, organizations, groups, leads, and tags, as well as creating and updating agents and leads.

Quick Start

To instantiate the Hustle class, you can either store your Hustle client ID and secret as environmental variables (HUSTLE_CLIENT_ID and HUSTLE_CLIENT_SECRET, respectively) or pass them in as keyword arguments:

from parsons import Hustle

# First approach: Use API credentials via environmental variables
hustle = Hustle()

# Second approach: Pass API credentials as arguments
hustle = Hustle(client_id='MYID', client_secret='MYSECRET')

# Export your groups to a csv
tbl = hustle.get_groups(organization_id='ORGID')
tbl.to_csv('my_hustle_groups.csv')

# Export organizations to Redshift
tbl.get_organizations().to_redshift('hustleschema.hustle_organizations')

# Import leads from a csv
leads = Table.from_csv('my_leads.csv')
group_id = 'MYGROUP'
hustle.create_leads(leads, group_id)

API