< back to index

HTTP request

GET https://api.wevoteusa.org/apis/v1/officeRetrieve (Jump to "Try It Now")

Required Parameters

Parameter name Value Description
voter_device_id string An 88 character unique identifier linked to a voter record on the server
api_key string (from post, cookie, or get (in that order)) The unique key provided to any organization using the WeVoteServer APIs
office_id integer The unique internal identifier for this office (either office_id OR office_we_vote_id required -- not both. If it exists, office_id is used instead of office_we_vote_id)
office_we_vote_id string The unique identifier for this office across all networks (either office_id OR office_we_vote_id required -- not both.) NOTE: In the future we might support other identifiers used in the industry.

Response

{
  "status": string,
  "success": boolean,
  "ballot_item_display_name": string,
  "ballotpedia_id": string,
  "ballotpedia_office_id": integer,
  "ballotpedia_office_name": string,
  "ballotpedia_office_url": string,
  "ballotpedia_race_id": integer,
  "ballotpedia_race_office_level": string,
  "district_name": string,
  "google_civic_election_id": integer,
  "id": integer,
  "kind_of_ballot_item": string (CANDIDATE, MEASURE),
  "last_updated": string (time in this format %Y-%m-%d %H:%M:%S),
  "maplight_id": string,
  "number_voting_for": integer,
  "number_elected": integer,
  "ocd_division_id": string,
  "primary_party": string,
  "race_office_level": string,
  "state_code": string,
  "we_vote_id": string,
  "wikipedia_id": string,
}

Response Status Codes

Code Description
VALID_VOTER_DEVICE_ID_MISSING Cannot proceed. A valid voter_device_id parameter was not included.
VALID_VOTER_ID_MISSING Cannot proceed. A valid voter_id was not found.

Try It Now: API Variables

Retrieve detailed information about one office.

Parameter name Value  
voter_device_id:
office_id:
office_we_vote_id:

(opens in new window)