< back to index

HTTP request

GET https://api.wevoteusa.org/apis/v1/twitterSignInRequest (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
voter_info_mode boolean We collapsed twitterSignInRequestAccessToken and twitterSignInRequestVoterInfo into one API call. When set to true, we run Step 2: twitterSignInRequestVoterInfo and otherwise run Step 3: twitterSignInRequestAccessToken.
return_url string The URL where the browser should be redirected once authenticated. Usually https://wevote.me/settings/account
api_key string (from post, cookie, or get (in that order)) The unique key provided to any organization using the WeVoteServer APIs

Optional Parameters

Parameter name Value Description
switch_accounts_if_needed boolean If a We Vote account already exists for this Twitter handle, create new session tied to that account. If this variable not passed in, defaults to true.

Response

{
  "status": string,
  "success": boolean,
  "voter_device_id": string (88 characters long),
  "twitter_handle": string,
  "twitter_handle_found": boolean,
  "voter_info_retrieved": boolean,
  "switch_accounts": boolean,
  "return_url": string, (This is the final url to return to once authentication is complete. If set, the twitterSignInRequestAccessToken api redirects to the twitterSignInRequestVoterInfo api before redirecting to the value in return_url)
}

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

Flow chart showing entire process here: https://docs.google.com/drawings/d/1WdVFsPZl3aLM9wxGuPTW3veqP-5EmZKv36KWjTz5pbU/edit

Parameter name Value  
voter_device_id:
voter_info_mode: True
False
return_url:
switch_accounts_if_needed: True
False

(opens in new window)