|
| 1 | +######### |
1 | 2 | ActionKit |
2 | | -========= |
| 3 | +######### |
3 | 4 |
|
4 | | -******** |
5 | 5 | Overview |
6 | | -******** |
| 6 | +======== |
7 | 7 |
|
8 | | -`ActionKit <https://actionkit.com/>`_ is a platform for advocacy, fundraising, and |
| 8 | +`ActionKit <https://actionkit.com/>`__ is a platform for advocacy, fundraising, and |
9 | 9 | get-out-the-vote. This Parsons integration with the |
10 | | -`ActionKit REST API <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html>`_ |
11 | | -supports fetching, creating, and updating records of campaigns, events, mailers, orders, survey questions, transactions, and users. |
12 | | -Bulk upload of new users and user updates is also supported. |
| 10 | +`ActionKit REST API <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html>`__ |
| 11 | +supports fetching, creating, and updating records of campaigns, events, mailers, orders, survey questions, |
| 12 | +transactions, and users. Bulk upload of new users and user updates is also supported. |
13 | 13 |
|
14 | | -.. note:: |
| 14 | +.. admonition:: Authentication |
15 | 15 |
|
16 | | - Authentication |
17 | | - ActionKit requires `HTTP Basic Auth <https://en.wikipedia.org/wiki/Basic_access_authentication>`_. |
18 | | - Clients with an ActionKit account can obtain the domain, username, and password needed |
19 | | - to access the ActionKit API. See the `ActionKit REST API Authentication <https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html#authentication>`_ |
20 | | - documentation for more information on obtaining ActionKit API credentials. |
| 16 | + ActionKit requires `HTTP Basic Auth <https://en.wikipedia.org/wiki/Basic_access_authentication>`__. |
| 17 | + Clients with an ActionKit account can obtain the domain, username, and password needed to access the ActionKit API. |
| 18 | + See the `ActionKit API Authentication Documentation`_ for more information on obtaining ActionKit API credentials. |
21 | 19 |
|
22 | | -********** |
23 | 20 | Quickstart |
24 | | -********** |
| 21 | +========== |
25 | 22 |
|
26 | | -To instantiate the ActionKit class, you can either store your ActionKit API |
| 23 | +To instantiate the :class:`~parsons.action_kit.action_kit.ActionKit` class, you can either store your ActionKit API |
27 | 24 | domain, username, and password as environmental variables (``ACTION_KIT_DOMAIN``, |
28 | 25 | ``ACTION_KIT_USERNAME``, and ``ACTION_KIT_PASSWORD``, respectively) or pass in your |
29 | 26 | domain, username, and password as arguments: |
30 | 27 |
|
31 | 28 | .. code-block:: python |
| 29 | + :caption: Use API credentials via environmental variables |
32 | 30 |
|
33 | 31 | from parsons import ActionKit |
34 | | -
|
35 | | - # First approach: Use API credentials via environmental variables |
36 | 32 | ak = ActionKit() |
37 | 33 |
|
38 | | - # Second approach: Pass API credentials as arguments |
| 34 | +.. code-block:: python |
| 35 | + :caption: Pass API credentials as arguments |
| 36 | +
|
| 37 | + from parsons import ActionKit |
39 | 38 | ak = ActionKit(domain='myorg.actionkit.com', username='my_name', password='1234') |
40 | 39 |
|
41 | 40 | You can then call various endpoints: |
42 | 41 |
|
43 | 42 | .. code-block:: python |
| 43 | + :caption: Create a new user |
44 | 44 |
|
45 | | - # Create a new user |
46 | | - ak.create_user(email='john@email', first_name='John', last_name='Smith', city='Boston') |
| 45 | + ak.create_user(email='john@email', first_name='John', last_name='Smith', city='Boston') |
47 | 46 |
|
48 | | - # Fetch user fields |
49 | | - user_fields = ak.get_user(user_id='123') |
| 47 | +.. code-block:: python |
| 48 | + :caption: Fetch user fields |
50 | 49 |
|
51 | | - # Update user fields |
52 | | - ak.update_user(user_id='123', city='New York') |
| 50 | + user_fields = ak.get_user(user_id='123') |
53 | 51 |
|
54 | | - # Delete user |
55 | | - ak.delete_user(user_id='123') |
| 52 | +.. code-block:: python |
| 53 | + :caption: Update user fields |
| 54 | +
|
| 55 | + ak.update_user(user_id='123', city='New York') |
| 56 | +
|
| 57 | +.. code-block:: python |
| 58 | + :caption: Delete user |
| 59 | +
|
| 60 | + ak.delete_user(user_id='123') |
56 | 61 |
|
57 | | -*** |
58 | 62 | API |
59 | | -*** |
| 63 | +==== |
60 | 64 |
|
61 | 65 | .. autoclass:: parsons.action_kit.action_kit.ActionKit |
62 | 66 | :inherited-members: |
63 | 67 | :members: |
| 68 | + |
| 69 | +.. _ActionKit API Authentication Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html#authentication |
| 70 | +.. _ActionKit API Action processing Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/actionprocessing.html |
| 71 | +.. _ActionKit API Ordering Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/overview.html#ordering |
| 72 | +.. _ActionKit API Uploads Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/uploads.html |
| 73 | +.. _ActionKit API Autocreate_user_fields Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/uploads.html#create-a-multipart-post-request |
| 74 | +.. _ActionKit API Users Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/users.html |
| 75 | +.. _ActionKit API Mailer Documentation: https://roboticdogs.actionkit.com/docs/manual/api/rest/mailer.html |
| 76 | +.. _ActionKit API Event Search Examples: https://roboticdogs.actionkit.com/docs/manual/api/rest/examples/eventsearch.html |
| 77 | +.. _ActionKit Email Blackhole Documentation: https://docs.actionkit.com/docs/manual/guide/mailings_tools.html#blackhole |
| 78 | +.. _Django Field Lookup Documentation: https://docs.djangoproject.com/en/3.1/topics/db/queries/#field-lookups |
0 commit comments