< back to index
HTTP request
GET https://api.wevoteusa.org/apis/v1/positionSave (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 |
google_civic_election_id |
integer |
ID of the election this position is related to. |
Optional Parameters
Parameter name |
Value |
Description |
position_we_vote_id |
string |
The unique identifier for this position across all networks. |
ballot_item_display_name |
string |
Text we display for the name of this office, candidate or measure. If missing, we look it up internally and fill it in. |
office_we_vote_id |
string |
The unique identifier for the office that the position is commenting on. (One and only one of these is required: office_we_vote_id, candidate_we_vote_id, measure_we_vote_id) |
candidate_we_vote_id |
string |
The unique identifier for the candidate that the position is commenting on. (One and only one of these is required: office_we_vote_id, candidate_we_vote_id, measure_we_vote_id) |
measure_we_vote_id |
string |
The unique identifier for the measure that the position is commenting on. (One and only one of these is required: office_we_vote_id, candidate_we_vote_id, measure_we_vote_id) |
organization_we_vote_id |
string |
The organization that is taking the position. (One and only one of these is required: organization_we_vote_id, public_figure_we_vote_id, voter_we_vote_id) |
public_figure_we_vote_id |
string |
The public figure (or voter) that is publicly taking the position. (One and only one of these is required: organization_we_vote_id, public_figure_we_vote_id, voter_we_vote_id) |
voter_we_vote_id |
string |
The voter that is privately taking the position. (One and only one of these is required: organization_we_vote_id, public_figure_we_vote_id, voter_we_vote_id) |
stance |
string |
SUPPORT, OPPOSE, INFORMATION_ONLY (future: STILL_DECIDING, NO_STANCE) |
set_as_public_position |
boolean |
Should this position be saved so it can be seen by anyone in the public, or only for friends |
statement_text |
string |
A text description of this stance. |
statement_html |
string |
An HTML description of this stance. |
more_info_url |
string |
The URL of the website where this stance can either be verified, or pursued in more depth. |
Response
{
"status": string,
"success": boolean,
"voter_device_id": string (88 characters long),
"new_position_created": boolean,
"ballot_item_display_name": string (either measure name or candidate name),
"speaker_display_name": string,
"speaker_image_url_https": string,
"speaker_twitter_handle": string,
"is_support": boolean,
"is_positive_rating": boolean,
"is_support_or_positive_rating": boolean,
"is_oppose": boolean,
"is_negative_rating": boolean,
"is_oppose_or_negative_rating": boolean,
"is_information_only": boolean,
"is_public_position": boolean,
"organization_we_vote_id": string (the organization identifier that moves server-to-server),
"position_we_vote_id": string (the position identifier that moves server-to-server),
"position_ultimate_election_date": integer,
"position_year": integer,
"public_figure_we_vote_id": string,
"voter_we_vote_id": string,
"google_civic_election_id": integer,
"voter_id": integer,
"office_we_vote_id": string,
"candidate_we_vote_id": string,
"measure_we_vote_id": string,
"stance": string (support/oppose/info only),
"statement_text": string,
"statement_html": string,
"more_info_url": string,
"last_updated": string (time in this format %Y-%m-%d %H:%M:%S),
}
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. |
POSITION_REQUIRED_UNIQUE_IDENTIFIER_VARIABLES_MISSING |
Cannot proceed. Missing sufficient unique identifiers for either save new or update. |
NEW_ORGANIZATION_REQUIRED_VARIABLES_MISSING |
Cannot proceed. This is a new entry and there are not sufficient variables. |
CREATE_POSITION_SUCCESSFUL |
Position created. |
POSITION_SAVED_WITH_POSITION_ID |
|
POSITION_SAVED_WITH_POSITION_WE_VOTE_ID |
|
POSITION_CHANGES_SAVED |
|
NO_POSITION_CHANGES_SAVED_WITH_POSITION_ID |
|
NO_POSITION_CHANGES_SAVED_WITH_POSITION_WE_VOTE_ID |
|
NO_POSITION_CHANGES_SAVED |
|
POSITION_COULD_NOT_BE_FOUND_WITH_POSITION_ID_OR_WE_VOTE_ID |
|
Try It Now: API Variables
Save a new position or update an existing position. Note that passing in a blank value does not delete an existing value. We may want to come up with a variable we pass if we want to clear a value.