Coding as Activism, a deep dive
- ➢ Home
- ➢ Blog posts
Tomorrow, I’ll be presenting a training on Coding as Activism at Netroots Nation, together with my colleague Sandy Gani. This training will give attendees an up-front look at the NGP VAN API, with a deep dive into the services which are used most broadly by apps and websites in every corner of the progressive movement. You couldn’t ask for a better introduction to the building blocks of progressive political technology, so if you’re in Atlanta, I certainly hope you join us!
Most of the training will be concerned with a live demo of a sample web app we built using .NET MVC. (And when I say “we”, I mostly mean “Sandy”, who has done virtually all the heavy lifting here.) When I first previewed this training, I spelled out the three use cases we’d look at. We’ve actually split it out a bit more, for pedagogical purposes:
- We’ll start out with a really simple sign up form, the kind you might see on any candidate’s web site. This form will volunteer data back to our API using the POST /people/findOrCreate service, which stores data about volunteers and generates a primary key, called a “VANID”, for those volunteers.
- The second screen displays a dashboard, showing the volunteer the details we have on hand and linking to some follow-up actions that volunteer can take. This screen relies on the GET /people/{vanId} service.
- The third screen is a really simple event RSVP form. This screen is built around an event that occurs in a single location, that lacks any shifts, and only has a single role which attendees may volunteer for. It’s the simplest example of an event RSVP for our system; all the user has to do is to click the “RSVP” button, and when that happens, the data posts back to our API using the POST /signups service.
- The fourth screen elaborates on the event RSVP form, by showing how volunteers can interact with a more complicated event, such as a phonebank. In this case, the volunteer can choose between multiple locations; can decide whether to show up for the morning or afternoon shift; and can decide which role to take - i.e., whether to help by making phone calls, entering data, or offering to bring food. This screen relies on the GET /events/{eventId} service in order to grab all of the relevant details.
- The fifth screen shows an example of “canvassing” a volunteer. Canvassing is just the act of asking a person some questions, and recording the data. In this screen we will ask the volunteer to indicate what she is willing to do for the campaign by presenting a series of checkboxes. The volunteer’s responses are posted back to our API as Activist Codes, using the POST /people/{vanId}/canvassResponses service.
- In the final screen, we elaborate on the concept of canvassing by looking at a different sort of question, a multiple-choice question which appears as a drop-down list. In this case the volunteer’s responses are posted back to our API as Survey Questions, again using the POST /people/{vanId}/canvassResponses service.
The result is a fully-functional web app for a progressive political candidate - the sort of thing that can help a candidate find and engage volunteers online. We built it with just a dash of bog-standard .NET MVC code, over the course of a few days. (For those who aren’t comfortable with .NET, we also provide equivalent code samples with cURL, and a Postman collection of the underlying API calls.) Really, the star in this project in the NGP VAN API, which takes care of all the tricky pieces, especially modeling and tracking field organizing data, for us.
What’s truly remarkable to me is the degree to which these same building blocks can be applied in just about every corner of the progressive movement. I have seen developers use these services to power very simple solutions at the state legislative level - and I have seen the exact same services standing behind major nationwide field organizing efforts, by organizations who count their supporters in the millions. Non-profits, political candidates, labor unions, and even foreign political parties have all had tremendous success using these services.
I think the mark of a good API is that it makes tricky things seem like a piece of cake. A great API is one that goes further, and allows developers to do powerful things with just a few lines of code. By that measure I think the NGP VAN API is really pretty remarkable, and I’m really excited to share it with other progressive software developers tomorrow!
Image courtesy of Roya Ann Miller