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:

  1. Open the Elections API Query Explorer website: https://api.ap.org/v3/elections/xplor?

  2. Enter your Elections API Key in the Enter your API Key field.

    You will have received this key by email from AP Customer Support.

  3. Click the Parameters icon to load the election data permissioned by your Elections API key.

  4. 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:

  1. Copy your new URL query to the clipboard using the Copy to Clipboard button and then pressing Ctrl C to copy from the popup.

  2. 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:\).

  3. Launch the AP Elections API Config Editor (APElectionsConfigEditor.exe).

  4. 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).

  5. 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.

  6. Paste the URL generated in Generate a URL Query into the URL field.

  7. 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.

  8. Click Update Config File.

  9. Click Exit.

  10. 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:

  1. Open APElectionsAPIConfig.exe.

  2. Navigate to the path of the config file.

  3. Check the information in the URL field.

    If it is correct, click Exit.

    If it is not correct:

    1. Make the changes as needed.

    2. Click Update Config File.

    3. Click Exit.

  4. 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.

  1. In the News Wire Profiler select File > New Wire.

  2. Select ELECTIONSAPI and click OK.

  3. Click the More button to view the wire's configuration settings. Saved Election queries can also be seen here.

  4. 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.