-
Notifications
You must be signed in to change notification settings - Fork 63
Representatives API Endpoints
kazvee edited this page Oct 30, 2023
·
2 revisions
This API returns the list of Representatives based on Zip code. Amplify does not store any data; this API leverages the Cicero API.
GET /{{api_version}}/official?search_postal={{postal_code}}&search_country={{2_character_country_code}}&key={{api_key}}
A list of JSON objects with Representative information for the provided Zip code.
Example Response Structure:
{
"response": {
"errors": [],
"messages": [],
"results": {
"candidates": [
{
"count": {
"to": number,
"total": number,
"from": number
},
"districts": [
... district objects ...
],
"match_postal": string,
"wkid": number,
"match_country": string,
"locator": string,
"score": number,
"match_region": string,
"match_city": string,
"match_addr": string,
"y": number,
"x": number,
"match_subregion": string,
"partial_match": boolean,
"geoservice": string
},
...
]
}
}
}
- The Zip code must be in either the 5-digit Zip format (
99999
) or 9-digits Zip+4 format (99999-9999
). - When only querying by Postal Code, a valid 2-character
ISO 3166-1 alpha-2 code
must be provided, for example:US
. - The
district_type
resource returns a list of District Type objects in its results. Thename_short
property values of these objects can be used to filter resource responses. - The API will return a
200 OK
code with message"errors": [ "No geocoding results found for address" ]
if either:- the Zip code format is correct, but the value is not a valid zip code (such as
99999
), or - the Zip code format is incorrect (such as
dog
).
- the Zip code format is correct, but the value is not a valid zip code (such as
- This API leverages the Cicero API. This API is not free. As of October 2023, discussions are ongoing with Cicero regarding a group development key.
- Home
- App Logic
- App Structure
- Getting Started
- Local Environment Setup
- Interacting with the Development Database
- User Background
- Features
- Data Structures
- API Quick Reference
- Single Campaign Mode (Beta)
- Front-end
- Components
- Pages
- State Management
- Amplify API reference (Database)
- Lob Mailing API integration
- Auth0 API Integration
- Stripe API integration
- Cicero API Integration
- Twilio API Integration