ActionKit API

This Gem provides a wrapper for the ActionKit API in a way that should feel pretty familiar if you're used to ActiveRecord (though this does not use or require ActiveRecord). I found that none existed and what we were using in our own code base was rough, undocumented and didn't conform to any expectations and it was failing in unusual and unpredictable ways. This is here to solve OUR problems and with any luck other people will be able to get some value out of it as well.

We intend to open up the repository on GitHub as soon as we're sure nothing sensitive leaked into it. In the mean time if you have suggestions for improvements, feature requests, or bug fixes please email me at: sstelfox at democracyforamerica dot com.

Features

Currently implemented:

  • Individual User Searching
  • Individual Page Searching (any type)
  • Searching on Page types: Petition, Signup, and Unsubscribe
  • Creating new Users, PetitionPages, SignupPages, and UnsubscribePages
  • Updating existing User and Page attributes
  • Taking Actions

For Future releases:

  • find_all_by_* for all models (currently beta and limited to 1000 results/query)
  • count on queries
  • Support for all page types
  • Validation logic on individual fields (all models)

Known Issues/Bugs

  • Currently overriding parts of XMLRPC standard library for our own ends, this may result in unexpected behaivior for applications that include this Gem and are using XMLRPC directly elsewhere, though the changes are fairly minor (User agent, and error code type validation).

Usage

Coming Soon

Testing Instructions

This Gem uses Cucumber for high-level integration and remote requests, while RSpec is for low level functionality and specifications. The RSpec tests do not require access to the actual API, everything is mocked out (with the exception of the certificate verification but that doesn't require credentials). To use most of the cucumber tests you need to have valid credentials for use with the ActionKit API. You can get more information on how to setup an API user in ActionKit's documentation. You need to place your credentials in /features/support/credentials.rb from the root of the Gem's directory. The Cucumber tests WILL create new users, pages, sign up users for pages and things that might otherwise affect live data.

Please be aware of what the tests are doing before running them.

Now that you've read the warning this is what the contents of the credentials file should look like:

# These are credentials that need to be set for testing against
# live ActionKit. This file will never live in the repository.

ACTIONKIT_HOSTNAME=""
ACTIONKIT_USERNAME=""
ACTIONKIT_PASSWORD=""