The Voter Registration API allows users to create applications that include voter registration functionality without being concerned with the details of creating PDFs, following up with voters, or the rules associated with registering in various states.
We hope that by releasing this API people with innovative online voter registration ideas will be able to build them without the effort that would have otherwise been required.
Using any DNC API requires the use of an API key. By default all API key users are rate limited – if your application requires a higher volume key, please get in touch.
In addition to signing up for an API key, you must sign up as a Raise Your Vote partner to use the API key with the voter registration API. You must also associate your API key with your Raise Your Vote partnership in the partner dashboard settings. This will allow registrations submitted via API to appear in your partner dashboard, alongside any registrations collected by partner widget.
Registration fields are the fields that are required to complete a registration form. These fields vary by state and include the following information for each field.
- name The name of the field.
- required A boolean that indicates whether the field is required.
- help_text Help text that can be displayed to the end user.
- label Human readable label for the field
- options For fields that are constrained to a set, the set of possible options
- validations Validations that can be applied to the field. These will also be enforced by the API when registrations are submitted.
These registration fields are returned as a collection of fields that define the fields for that state. They can be retrieved by performing an HTTP GET of the registration fields resource for that state:
There are some states and territories where registering via the API is not permitted. In those cases, the API will return an appropriate error condition. https://www.raiseyourvote.com/api/registration/fields/WY.json?lang=en&key=YOUR_API_KEY
Registrations are created by performing an HTTP POST to the https://www.raiseyourvote.com/api/registrations.json resource. The post must include the following elements as URL encoded key/value pairs on the query string. The post should have an empty body.
- key The API key to use for this registration.
- registration[address_state] The state that the registration is taking place in.
- registration fields for state The registration fields that the fields API indicate are required for a particular state. The key for each field should be registration[name] where name is the field name supplied by the registration fields API.
The following fields should be included in the registration if the Registration Fields API indicates that the field is required for a particular state, or if it is necessary to complete a name change or change of address form.
If the user has an optional mailing address:
If the user is changing their address:
If the user is changing their name:
Additional Optional Fields
The following fields are also allowed for all registrations, but are not required.
- registration[referer] The HTTP Referrer of the end user.
- registration[ip] The IP address of the end user.
- registration[source] A source code that is persisted with the registration. Can be used for analytics purposes.
Successful registration creation requests will return a url for the PDF that corresponds to the registration that was submitted. In addition, the system will add the registration to the partner dashboard associated with the API key, and send an email to the voter with a link to the PDF for their records.
If the registration is unsuccessful a collection of validation errors will be returned to the API consumer. These should be displayed to the user so they have the opportunity to correct the problem.
Most uses of the API will follow this pattern:
- A request is made for the registration fields for the state in which the end users it attempting to register to vote
- The registration fields are rendered by the consuming application, and the user completes them.
- A completed registration is collected by the consuming application and submitted to the registrations API.
- The system responds with a URL for a completed registration form, which the end user is redirected to.
- The registration is available to administrators in the partner dashboard.
If you have problems or questions, please send a message to the Open.Dems mailing list