Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Update ActionNetwork. #342

Merged
merged 3 commits into from
Aug 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions docs/action_network.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
Action Network
==========

********
Overview
********

`Action Network <https://actionnetwork.org/>`_ is an online tool for storing information
about and organizing volunteers and donors. For more information, see `Action Network developer docs <https://actionnetwork.org/docs>`_
about and organizing volunteers and donors. It is used primarily for digital organizing and event mangement. For more information, see `Action Network developer docs <https://actionnetwork.org/docs>`_

.. note::
Authentication
Only ActionNetwork partners are able to access their API. You can generate your key from the API & Sync page, located in the "Start Organizing" menu, in the right column.

***********
Quick Start
***********

To instantiate a class, you can either pass in the API token as an argument or set the ``AN_API_TOKEN`` environmental variable.

.. code-block:: python

from parsons import ActionNetwork, Table

an = ActionNetwork(API_TOKEN)
from parsons import VAN
Copy link
Contributor

@rgriff23 rgriff23 Aug 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should import ActionNetwork, not VAN.

I'm guessing this was copied from ActionKit, where I previously introduced this exact typo because I was using the VAN connector as my example. Maybe you can fix the ActionKit bug in your PR too, especially since it is referenced as an example for documentation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. And, yes, your theory is correct.

I've actually got this fixed in the S3 docs PR for AK, so I think that it should be fixed shortly there too.


# First approach: Use API credentials via environmental variables
an = ActionNetwork()

# Second approach: Pass API credentials as arguments
an = ActionNetwork(api_token='MY_API_TOKEN')

You can then call various endpoints:

.. code-block:: python

# List all people stored in Action Network
all_contacts = an.get_people_list()
Expand Down