Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephmisiti/e5fd41d3f53daa353166b7312708a612 to your computer and use it in GitHub Desktop.
Save josephmisiti/e5fd41d3f53daa353166b7312708a612 to your computer and use it in GitHub Desktop.
def get_quote(self, address, city, state, zipcode):
""" """
if not self.__token:
self.get_token_bearer()
assert len(state) == 2
resp = requests.request(
"POST",
'%s/Services/API/v1/Quote' % (self.__base_url),
headers={
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer %s' % self.__token,
},
data={
"BuildingCoverage": "250000",
"ContentsCoverage": "100000",
"DateOfConstruction": "01/01/1914",
"BuildingUsage": "1",
"FoundationType": FOUNDATION_TYPE['BASEMENT_BELOW_GRADE'],
"StructureType": "Dwelling",
"InsuredType": "Owner",
"NumberOfFamilies": "1 Family",
"NumberOfStories": "2",
"InsuredFirstName": "John",
"InsuredLastName": "Doe",
"PropertyAddressLine1": str(address),
"PropertyAddressCity": str(city),
"PropertyAddressState": str(state),
"PropertyAddressPostalCode": str(zipcode),
"TrackingID": "13233880", # we
},
)
assert resp.status_code == 200
response_json = json.loads(resp.text)
return response_json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment