Created
April 2, 2020 18:59
-
-
Save josephmisiti/e5fd41d3f53daa353166b7312708a612 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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