Election JSON file
This guide provides an overview of the json file that can be used to import an election configuration.
Other relevant guides are:
How to export an election JSON file: Summary
How to import an election JSON file: Getting started with Electa
A template JSON file can also be found attached to this guide (it includes a folder with the images used in the template JSON file):
Important caveats
The order of the attributes shown in this guide reflects the way the JSON file is structured – for a successful importing process using this file, it is very important that this order is respected; otherwise, the importer fails.
This guide will show how the different attributes can be modified and will additionally link to the respective sections that explain the specific feature. This guide does not explain how each attribute behaves in the system – please refer to the relevant guide for that.
For any images used in the JSON file (e.g., logos or backgrounds), they must be stored in a folder. This folder, together with the JSON file, is then compressed into a zip file and is ready to be imported into the system. Note: The importer only accepts zip folders. See below for an example of the structure:
Overview of the main attributes in the JSON file
Below is an overview of the main attributes that can appear in the JSON file, as well as which are required for different types of elections.
As a minimum, all elections need configurations, contests, and voter groups (ie. attributes: “election_attributes”, “contests_attributes”, “voter_groups_attributes”, and “contest_voter_groups_attributes”).
Attribute | Required for | Read more |
|---|---|---|
“election_attributes” | These are attributes referring to the general configuration of the election. It is then needed for all election types. | |
“contests_attributes” | These are attributes referring to the configuration of the ballots. It is then needed for all election types. | |
“voting_rounds_attributes” | These are attributes referring to the configuration of the voting rounds. This set of attributes is mainly needed for Scheduled Voting. | |
“voter_groups_attributes” | These are attributes referring to the voter groups. It is then needed for all election types. | |
“slides_attributes” | These are attributes referring to the configuration of slides used in Live Voting As such, this set of attributes is mainly needed for Live Voting. | |
“contest_voter_groups_attributes” | This set of attributes ensures that voter groups are linked to the contests. It is then needed for all election types. | |
“contest_voting_rounds_attributes” | This set of attributes ensures that voting rounds are linked to the contests. It is mostly needed for Scheduled Voting. | |
“templates_attributes” | These are attributes referring to the templates: emails or SMS sent out from the system. It can be used for both live voting and scheduled voting, depending on whether that is needed for your election. | |
“translations_attributes” | These are attributes referring to the translations of the election. The system already has default translations for different languages. It is only needed in the JSON file if you wish to make any concrete changes to the default translations. |
Table of Contents
This guide is structured to mimic the structure of the JSON file, which means that this guide can be read in tandem with looking at the JSON file.
1. Configuration
This section corresponds to all the features under Configuration, which in the JSON file are called “election_attributes”. Refer to theConfiguration page to read more about all the Configuration features.
Main attribute in the JSON file | Keys in the attribute | Values | Corresponding feature in Electa | |
|---|---|---|---|---|
(this is the outer layer, inside “election_attributes”) | (these are the inner layers, for each main attribute) | (these are the valid data types for each key, as well as the relevant options in the system) | (link to page in User Manual) | |
data | locales |
| ar/ ca/ cy/ da/ de/ en/ es/ fi/ fr/ is/ it/ nl/ pl/ pt/ ro/ ru/ sv/ ja/ zh/ ko | |
curve_name |
| secp256k1/ secp256r1/ secp384r1/ secp521r1 |
| |
election_client | redirect_method | disabled/ board/ custom_url/ sign-in | ||
hide_footer | true/false | |||
utilize_screenspace | true/false | |||
redirect_url | for each locale, input a URL | |||
direct_token_public_key | input a string of your choice | |||
stream | stream_url | input a URL | ||
theme | color | input a color code in hex format | ||
danger | input a color code in hex format | |||
text_color | contrast/ white/ black | |||
logo | input the name of the file uploaded as image | |||
login_background | input the name of the file uploaded as image
| |||
splash_background | null/ self_upload/ from_gallery | |||
default_slide_background | null/ self_upload/ from_gallery | |||
login_selector | null/ self_upload/ from_gallery | |||
login_gallery_background | input the name of the file uploaded as image
| |||
image_option | square/ passport | |||
default_selector | null/ from_gallery/ self_upload | |||
default_slide_gallery_background | input the name of the file uploaded as image
| |||
splash_selector | null/ from_gallery/ self_upload | |||
splash_gallery_background | input the name of the file uploaded as image
| |||
election_codes | election_code_1_label | for each locale, input a text | ||
election_code_2_label | for each locale, input a text | |||
election_code_3_label | for each locale, input a text | |||
amount | input one number from 1 to 3 | |||
election_code_1_help | for each locale, input a text | |||
election_code_1_placeholder | for each locale, input a text | |||
login_link_prefill |
| |||
election_code_1_visibility | visible/ hidden | |||
access | restrict_observer_access | true / false | ||
observer_name | input a string of your choice | |||
observer_password | input a string of your choice | |||
allowed_domains | input a URL | |||
voter_counts | shown_counts |
| ||
progress_bar_shows |
| |||
sign_up | enabled | true/false | ||
required | true/false | |||
info | ||||
schedule | enable_at disable_at | ISO 8601 formatted timestamp (as the example below shows)
| ||
user_modules | comments amendments candidacies voting_rounds | true/false | ||
e2e_verifiability | send_tracking_code_by_email | true/false | ||
download_voting_receipt | true/false | |||
hide_benaloh | true/false | |||
benaloh_challenge_timeout | number (integer) | |||
hide_dbas | true/false | |||
show_confirm_votes | true/false | |||
election_verification_site | contact_url | for each locale, input a URL | ||
description |
| |||
status |
| open/ closed/ scheduled | ||
trust_mode |
|
| trusted |
|
election_client_external_sign_in_url |
|
| for each locale, input a URL | Configuration: “External sign in URL” |
voter_session_timeout |
|
| number (integer) | |
voting_round_timeout |
|
| number (integer) | |
manual_initialisation |
|
| true/false | |
internal_name |
|
| input a string of your choice | Configuration: Internal name |
election_client_sign_in_method |
|
| election_codes/ external/ both | Configuration: “Sign in method” |
theme__logo |
|
| input “file_ref:” followed by the name of the file uploaded as image | |
theme__login_background |
|
| input “file_ref:” followed by the name of the file uploaded as image | |
locales |
|
| ar/ ca/ cy/ da/ de/ en/ es/ fi/ fr/ is/ it/ nl/ pl/ pt/ ro/ ru/ sv/ ja/ zh/ ko | |
title |
|
| for each locale, input a text | Configuration: Title |
2. Contest
This section corresponds to all features under Contest, which in the JSON file are called “contests_attributes”. Refer to the Contest page to read more about all the Contest features. Inside “contests_attributes”, there will be a set of attributes that are repeated for however many contests are needed in the election.
Main attribute in the JSON file | Keys in the attribute | Values | Corresponding feature in Electa | |
|---|---|---|---|---|
(this is the outer layer, inside “contests_attributes”) | (these are the inner layers, for each main attribute) | (these are the valid data types for each key, as well as the relevant options in the system) | (link to page in User Manual) | |
internal_name |
| |||