Skip to content

Commit

Permalink
update overview and quickstart according to issue move-coop#269
Browse files Browse the repository at this point in the history
  • Loading branch information
rgriff23 committed Jul 16, 2020
1 parent 595e6da commit 06efe30
Showing 1 changed file with 39 additions and 5 deletions.
44 changes: 39 additions & 5 deletions docs/action_kit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,53 @@ ActionKit
Overview
********

The ActionKit class allows you to interact with an `ActionKit <https://actionkit.com/>`_.
`ActionKit <https://actionkit.com/>`_ is a platform for advocacy, fundraising, and
get-out-the-vote. This parsons integration with the
`ActionKit REST API <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html>`_
supports fetching, creating, and updating records of campaigns, events, and users.
Bulk upload of new users and user updates is also supported.

.. note::
Authentication
ActionKit requires `HTTP Basic Auth <https://en.wikipedia.org/wiki/Basic_access_authentication>`_.
Clients with an ActionKit account can obtain the domain, username, and password needed
to access the ActionKit API. See the `ActionKit REST API Authentication <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html#authentication>`_
documentation for more information on obtaining ActionKit API credentials.

**********
Quickstart
**********

**Retrieve a User**
To instantiate the ActionKit class, you can either store your ActionKit API
domain, username, and password as environmental variables (ACTION_KIT_DOMAIN,
ACTION_KIT_USERNAME, and ACTION_KIT_PASSWORD, respectively) or pass in your
domain, username, and password as arguments:

.. code-block:: python
from parsons import ActionKit
ak = ActionKit()
user_data = ak.get_user(123)
from parsons import VAN
# First approach: Specify DB type and pass API credentials via environmental variables
ak = ActionKit(db='MyVoters')
# Second approach: Pass API credentials as arguments
ak = ActionKit(domain='myorg.actionkit.com', username='my_name', password='1234')
You can then call various endpoints:

.. code-block:: python
# Create a new user
ak.create_user(email='john@email', first_name='John', last_name='Smith', city='Boston')
# Fetch user fields
user_fields = ak.get_user(user_id='123')
# Update user fields
ak.update_user(user_id='123', city='New York')
# Delete uer
ak.delete_user(user_id='123')
***
API
Expand Down

0 comments on commit 06efe30

Please sign in to comment.