ColdFusion API Documentation

The Skypunch API is written in ColdFusion. When the website consuming the API’s web services is also ColdFusion-powered, there are some spots where developers may simply pass the entire FORM scope as a native ColdFusion structure to the API which bypasses having to create some XML. This is only applicable for the three methods listed in the Skypunch Technology API documentation under the following headings:

  1. Get ballot step one
  2. Get ballot step two
  3. Get ballot step three

When taking this approach, the consuming website is invoking the WSDL associated with the REST API's underlying ColdFusion component, rather than doing an HTTP post of form variables to a REST endpoint. Instead of crafting requests as detailed in the API documentation, simply copy and paste the code samples below, then provide your own values for the parameters. Replace values in bold and italics with your own values.

Get ballot step one

<cfinvoke webservice="https://www.electionsonline.com/components/rest/v1/ballot.cfc?wsdl"
	returnvariable="viewBallot"	
	method="step_one"
	username="Your API username assigned by Skypunch."
	password="Your API password assigned by Skypunch."
	key="The API token assigned to your account."
	electionID="The ID of your election."
	voterID="Each voter's unique identifier."
	voterGroup="The voter's voterGroup code."
	voted="False for voters who've not voted, true for those who have."
	voterType="voter"
	weight="The weight of the voter's ballot."
	sigs="Comma-delimited string of the voter's SIG codes."
	js="False for browsers that don't support javascript, true for those that do.">

<form method="post" action="confirm.cfm">
	<cfoutput>#viewBallot#</cfoutput>
</form>

Get ballot step two

<cfinvoke webservice="https://www.electionsonline.com/components/rest/v1/ballot.cfc?wsdl"
	returnvariable="confirmBallot"
	method="step_two"
	username="Your API username assigned by Skypunch."
	password="Your API password assigned by Skypunch."
	electionID="The ID of your election."
	ballot="#form#"
	voterID="Each voter's unique identifier."
	weight="The weight of the voter's ballot."
	languages="Comma-delimited string of supported language codes."
	voterType="voter">
  
<form method="post" action="insert.cfm">
	<cfoutput>#confirmBallot#</cfoutput>
</form>

Get ballot step three

<cfinvoke webservice="https://www.electionsonline.com/components/rest/v1/ballot.cfc?wsdl"
	returnvariable="insertBallot"
	method="step_three"
	username="Your API username assigned by Skypunch."
	password="Your API password assigned by Skypunch."
	electionID="The ID of your election."
	ballot="#form#"
	voterID="Each voter's unique identifier."
	weight="The weight of the voter's ballot."
	voterGroup="The voter's voterGroup code."
	sigs="Comma-delimited string of the voter's SIG codes."
	languages="Comma-delimited string of supported language codes."
	voterType="voter">
	custom1=""
	custom2=""
	custom3=""
	custom4="">

<cfdump var="#insertBallot#">