Configure Election Wires
Elections can automatically process election data received via a standard AP wire feed to the more comprehensive AP Election Wire. Regardless of which AP wire you may be using, the data can be ingested via the AP Elections API. Other election data feeds are not officially supported, but may work if the format matches that of the AP wire.
If your site is interested in purchasing the AP election wire you should contact your AP Sales Executive for more information. If you plan to use the AP election wire, it should be set up before you configure Elections.
Make sure you set up and test the election feature of ENPS at least four weeks before an election.
Contact AP Customer Support at 1-844-777-2006 or apcustomersupport@ap.org for the schedule for sending test elections wires. The software testing should include testing the software interface with your character generator.
Step 1: Configure the Election API
If you subscribe to AP's Election Wire, you must configure the Election API wire for ingest to create your races.
Generate a URL Query
To generate a URL query, which will be used by ENPS to utilize AP's election results data:
-
Open the Elections API Query Explorer website: https://api.ap.org/v3/elections/xplor?
-
Enter your Elections API Key in the Enter your API Key field.
You will have received this key by email from AP Customer Support.
-
Click the Parameters icon to load the election data permissioned by your Elections API key.
-
Create your API Query URL by setting the following items in the Parameters section:
Parameter
Description
Election Date
The date of your election.
statePostal
The state that you are permissioned to capture results for.
Race(s)
The races you want to cover in ENPS.
If you want to cover all the races in your state, you will not need to use this dropdown.
resultsType
Set to test.
level
Set to ru.
format
Set to json.
Use the URL Query to Update the Configuration
Use the URL query:
-
Copy your new URL query to the clipboard using the Copy to Clipboard button and then pressing Ctrl C to copy from the popup.
-
Download the AP Elections API Config Editor (APElectionsConfigEditor.exe) from the ENPS Extras section of the ENPS Downloads site and save it to the root of the ENPS Work Drive (typically F:\).
-
Launch the AP Elections API Config Editor (APElectionsConfigEditor.exe).
-
To the right of the Path to Config File field, click the three dots to open the menu and select the path to your APElectionsAPIIngest.exe.config file (typically found in F:\ElectionsApiIngestService).
-
Update the following fields, ensuring you click Save after making each of the changes.
-
Query Name - Name your query with an easily identifiable name for your election (example:
OH Spring Election
). -
ApiKey - Enter the API Key provided to you by AP Customer Support.
-
-
Paste the URL generated in Generate a URL Query into the URL field.
-
Ensure that
https://api.ap.org/v3
appears at the start of the pasted query URL.If not, click Copy to Clipboard again followed by Ctrl C at the popup prompt. Then re-paste into the URL field.
-
Click Update Config File.
-
Click Exit.
-
Open Windows Services and start (or restart) the ENPS Elections API Ingest Service.
The ElectionsAPI can support multiple states and multiple query strings. Please contact the ENPS Helpdesk for assistance.
Step 2: Test the Election Data
When you are testing election data in advance of an election, the test value should be set as resultsType=test
in the Elections API Query Explorer website. On Election Day, you will relaunch APElectionsConfigEditor.exe. The application will display a warning that the date of the election query is Today and that you should change the Result Type field to set the value to resultsType=l. In this instance, the lowercase L stands for live data. As all testing has been completed, AP will only send live data transmissions.
Although The Associated Press only sends test election wires at specific times, you can conduct tests any time by using the data on AP's Elections API servers.
To test the wire:
-
Open
APElectionsAPIConfig.exe
. -
Navigate to the path of the config file.
-
Check the information in the
URL
field.If it is correct, click Exit.
If it is not correct:
-
Make the changes as needed.
-
Click Update Config File.
-
Click Exit.
-
-
Open Windows Services and start (or restart) the ENPS Elections API Ingest Service.
Election Wires via AP Media API
The NWP may now be configured to convert election results returned by the Elections API Ingest service into wire stories.
First, ensure that you have completed the steps in Step 1: Configure the Election API.
Next, complete the following steps to configure an Elections API feed as a wire in the ENPS client.
-
In the News Wire Profiler select File > New Wire.
-
Select ELECTIONSAPI and click OK.
-
Click the More button to view the wire's configuration settings. Saved Election queries can also be seen here.
-
Select the Elections API Source Queries that you want to appear as wire stories in the ENPS client.
If the Active checkbox is selected it must be unchecked before changes can be made to the wire settings.