Dory Overview
With the Dory's Insurance Distribution API, you can present insurance quotes to your users with maximized discounts all within your own app or website.
- How to authenticate with our API
- Create and update user information
- Generate insurance quotes for users
- Retrieve quote information
- Generate a JWT access token in order to communicate with all Dory APIs
- Create a user by sending a POST request to our
/user/v1
endpoint - Start the quote generation process by sending a POST request to
/quote/v1
with user ID and type of insurance quote you want to receive - Listen for webhook to be delivered containing the quote ID and it’s status
- Fetch details about the quote by sending a GET request to
/quote/v1/:id
Authentication
To authenticate with Dory’s API, you must generate a JWT token and then pass it in the Authorization
header in your request . You will be given a client secret to sign the JWT. The format is as follows:
partnerId
is your unique identifier in our systemkeyId
is a key identifier associated to your accountexp
is an epoch timestamp in seconds and must be valid for less than 2 hours
{
"alg": "HS256",
"typ": "JWT"
}
{
"partnerId": "2057",
"keyId": "Q9RQ3fa9JRnTf6Rsko",
"exp": 1516239022
}
HMACSHA256 signed with client secret
You now use this JWT on all requests with Dory API endpoints.
User Information
After generating a JWT, you may now start the first step in our quote process by creating a User in our system. Most of the parameters are required. By including the optional parameters, you can maximize the discount amount of the quote.
Create A User
Creates a unique user in our system tied to your account. Address verification is strongly recommended to be handled in your application before submitting data to us. Wrong or invalid addresses could result in failures for generating quotes. Only the specified properties below are accepted on this request. All other properties should be updated using the update endpoint.
curl --location --request POST '/user/v1' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "meet",
"lastName": "dory",
"address": {
"city": "Columbus",
"state": "OH",
"country": "US",
"zip": "43212",
"address1": "1920 Edgemont Rd",
"address2": "Apt 302"
},
"email": "[email protected]",
"phone": "+15555559992",
"dateOfBirth": "MM/DD/YYYY",
"typeOfHome": "house",
"isHomeOwner": true,
"proMonitoringEnabled" : true,
"devices": {
"moisture": "1",
"theft": "6",
"smoke": "2",
"motion": "1",
"waterShutoff": "0",
"fire": "0"
}
}'
require "uri"
require "json"
require "net/http"
url = URI("/user/v1")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
request.body = JSON.dump({
"firstName": "meet",
"lastName": "dory",
"address": {
"city": "Columbus",
"state": "OH",
"country": "US",
"zip": "43212",
"address1": "1920 Edgemont Rd",
"address2": "Apt 302"
},
"email": "[email protected]",
"phone": "+15555559992",
"dateOfBirth": "MM/DD/YYYY",
"typeOfHome": "house",
"isHomeOwner": true,
"proMonitoringEnabled": true,
"devices": {
"moisture": "1",
"theft": "6",
"smoke": "2",
"motion": "1",
"waterShutoff": "0",
"fire": "0"
}
})
response = http.request(request)
puts response.read_body
var axios = require('axios');
var data = JSON.stringify({
"firstName": "meet",
"lastName": "dory",
"address": {
"city": "Columbus",
"state": "OH",
"country": "US",
"zip": "43212",
"address1": "1920 Edgemont Rd",
"address2": "Apt 302"
},
"email": "[email protected]",
"phone": "+15555559992",
"dateOfBirth": "MM/DD/YYYY",
"typeOfHome": "house",
"isHomeOwner": true,
"proMonitoringEnabled": true,
"devices": {
"moisture": "1",
"theft": "6",
"smoke": "2",
"motion": "1",
"waterShutoff": "0",
"fire": "0"
}
});
var config = {
method: 'post',
url: '/user/v1',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"id": "wd4kZcAw1648147055",
"createdAt": "2020-07-10 15:00:00.000",
"updatedAt": "2020-07-10 15:00:00.000",
"partnerId": "6042",
"firstName": "meet",
"lastName": "dory",
"address": {
"city": "Columbus",
"state": "OH",
"country": "US",
"zip": "43212",
"address1": "1920 Edgemont Rd",
"address2": "Apt 302"
},
"email": "[email protected]",
"phone": "+15555559992",
"dateOfBirth": "MM/DD/YYYY",
"typeOfHome": "house",
"isHomeOwner": true,
"proMonitoringEnabled" : true,
"devices": {
"moisture": "1",
"theft": "6",
"smoke": "2",
"motion": "1",
"waterShutoff": "0",
"fire": "0"
}
}
HTTP Request:
POST
/user/v1
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Output Schema of Request
Field | Description | Required | Type |
---|---|---|---|
firstName | User's First Name | Yes |
String |
lastName | User's Last Name | Yes |
String |
address | Object of User's Address | Yes |
String |
address.address1 | Street Address | Yes |
String |
address.address2 | Apartment Number | Yes |
String |
address.city | City | Yes |
String |
address.state | State | Yes |
String |
address.country | Country ISO 2 Format | Yes |
String |
address.zip | Zipcode | Yes |
String |
User's Email Address | Yes |
String |
|
phone | Phone Number include Country Code | Yes |
String |
dateOfBirth | Birthday | Yes |
String |
typeOfHome | Type of Home | Yes |
String |
isHomeOwner | Does user own a home | Yes |
Boolean |
proMonitoringEnabled | User has professional security monitoring system | Yes |
Boolean |
devices | List of security devices | Optional |
Object |
devices.moisture | # of Moisture Devices | Optional |
String |
devices.theft | # of Theft Devices | Optional |
String |
devices.smoke | # of Smoke Devices | Optional |
String |
devices.motion | # of Motion detection Devices | Optional |
String |
devices.waterShutoff | # of Water Shutoff Devices | Optional |
String |
devices.fire | # of Fire Detect Devices | Optional |
String |
house |
apartment |
condo |
mobileHome |
Get User Information
Retrieves details about the user in our system. Supply the unique ID that was returned in the creation request to fetch the user's information.
curl --location --request GET '/user/v1/wd4kZcAw1648147055' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--data-raw ''
require "uri"
require "net/http"
url = URI("/user/v1/wd4kZcAw1648147055")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
response = http.request(request)
puts response.read_body
var axios = require('axios');
var config = {
method: 'get',
url: '/user/v1/wd4kZcAw1648147055',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"id": "wd4kZcAw1648147055",
"createdAt": "2020-07-10 15:00:00.000",
"updatedAt": "2020-07-10 15:00:00.000",
"partnerId": "6042",
"firstName": "meet",
"lastName": "dory",
"address": {
"city": "Columbus",
"state": "OH",
"country": "US",
"zip": "43212",
"address1": "1920 Edgemont Rd",
"address2": "Apt 302"
},
"email": "[email protected]",
"phone": "+15555559992",
"dateOfBirth": "MM/DD/YYYY",
"typeOfHome": "house",
"isHomeOwner": true,
"proMonitoringEnabled" : true,
"devices": {
"moisture": "1",
"theft": "6",
"smoke": "2",
"motion": "1",
"waterShutoff": "0",
"fire": "0"
}
}
HTTP Request:
GET
/user/v1/:id
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Get Detailed User Information
Our User object contains a large number of properties to help find and calculate the best insurance rates. To serve all this data in an optimal way, we have 2 dedicated APIs to get the user’s information. The previous endpoint returns the basic information about the user and keeps response payloads small. This expanded endpoint will return all the properties in its entirety in the response.
curl --location --request GET '/user/v1/wd4kZcAw1648147055/details' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--data-raw ''
require "uri"
require "net/http"
url = URI("/user/v1/wd4kZcAw1648147055/details")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
response = http.request(request)
puts response.read_body
var axios = require('axios');
var config = {
method: 'get',
url: '/user/v1/wd4kZcAw1648147055/details',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"paidInFull": "yes",
"lastName": "dory",
"homePurchaseDate": "01/30/1987",
"policyNumber": "NO123",
"carVin": "abc123",
"agentFirstName": "A",
"email": "[email protected]",
"firstName": "meet",
"electronicFundTransfer": "yes",
"dateOfBirth": "01/30/1987",
"id": "wd4kZcAw1648147055",
"paperless": "yes",
"retired": "yes",
"qualify": true,
"phone": "+12623207190",
"typeOfHome": "apartment",
"carCount": 2,
"partnerId": "1000",
"agentPhone": "+1234567891",
"devices": {
"smoke": "0",
"waterShutoff": "1",
"fire": "0",
"moisture": "3",
"motion": "0",
"theft": "0",
"deadbolt": "0",
"fireExtinguisher": "0",
"fireSmokeCo": "4",
"sprinkler": "3",
"leakDetection": "2",
"powerGenerator": "1"
},
"agentLastName": "B",
"loyalty": 5,
"createdAt": "2022-09-29 11:55:07.000",
"isSpecialOccupation": True,
"address": {
"city": "Columbus",
"state": "OH",
"country": "US",
"zip": "43212",
"address1": "1920 Edgemont Rd",
"address2": "Apt 302"
},
"claimFree": 5,
"premiumPaid": "Yearly",
"agentEmail": "[email protected]",
"proMonitoringEnabled": null,
"carOwner": "yes",
"maritalStatus": "Married",
"updatedAt": "2022-09-29 11:55:07.000",
"educationLevel": "High School",
"isHomeOwner": true,
"mortgageFreeAndLienFree": "yes",
"insurerName": "Roo Insurance",
"upgrades": {
"fortified": "11",
"storm": "22",
"roof": "33",
"electrical": "44",
"plumbing": "55",
"heating": "66"
},
"proMonitoringTheftEnabled": true,
"proMonitoringFireEnabled": true,
"proMonitoringLeakEnabled": true,
"proMonitoringWaterShutoffEnabled": true,
"isGated": true,
"isSmokingFree": true,
"insurerId": "safa23",
"didSubmitDiscount": true,
"conProvidePhotoCertificate": true,
"policyAmount": "5445",
"policyExpirationMonth": "january",
}
HTTP Request:
GET
/user/v1/:id/details
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Update A User
Updates the specific details by setting the values of the parameters passed. Any parameters not provided will be left unchanged. There are no required parameters in this request.
curl --location --request PATCH '/user/v1/wd4kZcAw1648147055' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--header 'Content-Type: application/json' \
--data-raw '{
"address": {
"city": "New York",
"state": "NY",
"country": "US",
"zip": "10011",
"address1": "6 W 18th Street",
"address2": "8th Floor"
}
}'
require "uri"
require "json"
require "net/http"
url = URI("/user/v1/wd4kZcAw1648147055")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Patch.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"address": {
"city": "New York",
"state": "NY",
"country": "US",
"zip": "10011",
"address1": "6 W 18th Street",
"address2": "8th Floor"
}
})
response = http.request(request)
puts response.read_body
var axios = require('axios');
var data = JSON.stringify({
"address": {
"city": "New York",
"state": "NY",
"country": "US",
"zip": "10011",
"address1": "6 W 18th Street",
"address2": "8th Floor"
}
});
var config = {
method: 'patch',
url: '/user/v1/wd4kZcAw1648147055',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8',
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns
200
HTTP Request:
PATCH
/user/v1/:id
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Pause a User
Removing a user from our systems is a 2 step process. First, send a Patch request to pause the user's account. This will halt any insurance discount related requests and remove notifications. Use the Delete endpoint to remove all sensitive data stored for the given user.
curl --location --request PATCH '/user/v1/:userId/pause' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--header 'Content-Type: application/json' \
require "uri"
require "json"
require "net/http"
url = URI("/user/v1/:userId/pause")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Patch.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
response = http.request(request)
puts response.read_body
var axios = require('axios');
var config = {
method: 'PATCH',
url: '/user/v1/:userId/pause',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8',
'Content-Type': 'application/json'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns a 200 Code
HTTP Request:
PATCH
/user/v1/:userId/pause
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Resume a User
If a user's status has been paused, use this endpoint to resume an active status for the user in the Dory system. This will resume any insurance discount related requests and notifications.
curl --location --request Patch '/user/v1/:userId/resume' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--header 'Content-Type: application/json' \
require "uri"
require "json"
require "net/http"
url = URI("/user/v1/:userId/resume")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Patch.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
response = http.request(request)
puts response.read_body
var axios = require('axios');
var config = {
method: 'PATCH',
url: '/user/v1/:userId/resume',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8',
'Content-Type': 'application/json'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns a 200 Code
HTTP Request:
PATCH
/user/v1/:userId/resume
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Delete a User
In order to delete a user, you must first pause the account. Then use the delete requests removes all sensitive data about the user in our system.
curl --location --request DELETE '/user/v1/:userId' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--header 'Content-Type: application/json' \
require "uri"
require "json"
require "net/http"
url = URI("/user/v1/:userId")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Delete.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
response = http.request(request)
puts response.read_body
var axios = require('axios');
var config = {
method: 'DELETE',
url: '/user/v1/:userId',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8',
'Content-Type': 'application/json'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns a 200 Code
HTTP Request:
Delete
/user/v1/:userId
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Skeleton User Creation
Sometimes you may not have the recommended properties for a Dory user in your system at time of creation. This endpoint has minimal required parameters to create the object in our system. This endpoint can also be called in a batch request for quick user creation from your database and can contain any of the properties in the User schema table in the request.
curl --location --request POST '/ingest/v1/user' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "meet",
"lastName": "dory",
"email": "[email protected]"
}'
require "uri"
require "json"
require "net/http"
url = URI("/ingest/v1/user")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
request.body = JSON.dump({
"firstName": "meet",
"lastName": "dory",
"email": "[email protected]"
})
response = http.request(request)
puts response.read_body
var axios = require('axios');
var data = JSON.stringify({
"firstName": "meet",
"lastName": "dory",
"email": "[email protected]"
});
var config = {
method: 'post',
url: '/ingest/v1/user',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"id": "3DW4FKK31ge3m4433",
"firstName": "meet",
"lastName": "dory",
"email": "[email protected]"
}
HTTP Request:
POST
/ingest/v1/user
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Field | Description | Required | Type |
---|---|---|---|
firstName | User's First Name | Yes |
String |
lastName | User's Last Name | Yes |
String |
User's Email | Yes |
String |
User Schema
The table below shows all the properties that can be added and updated to the User object.
Field | Description | Type |
---|---|---|
firstName | User's First Name | String |
lastName | User's Last Name | String |
address | Object of User's Address | String |
address.address1 | Street Address | String |
address.address2 | Apartment Number | String |
address.city | City | String |
address.state | State | String |
address.country | Country ISO 2 Format | String |
address.zip | Zipcode | String |
User's Email Address | String |
|
phone | Phone Number include Country Code | String |
dateOfBirth | Birthday (MM/DD/YYYY) | String |
typeOfHome | Type of Home | String |
isHomeOwner | Does user own a home | Boolean |
proMonitoringTheftEnabled | User has professional monitoring theft system | Boolean |
proMonitoringFireEnabled | User has professional monitoring fire system | Boolean |
proMonitoringLeakEnabled | User has professional monitored leak detection system | Boolean |
proMonitoringWaterShutoffEnabled | User has professional monitored water shutoff system | Boolean |
devices | List of security devices | Object |
devices.theft | # of Theft Devices | String |
devices.waterShutoff | # of Water Shutoff Devices | String |
devices.deadbolt | # of Deadbolt | String |
devices.fireExtinguisher | # of Fire Extinguisher | String |
devices.fireSmokeCo | Local Fire/ Self Monitored Fire | String |
devices.sprinkler | # of Sprinkler | String |
devices.leakDetection | # of Leak Detection | String |
devices.powerGenerator | # of Power Generator | String |
upgrades | List of upgrades to house | Object |
upgrades.fortified | FORTIFIED standard home construction | Boolean |
upgrades.storm | Storm Shutter | Boolean |
upgrades.roof | Roof Upgrade | Boolean |
upgrades.electrical | Electrical Upgrade | Boolean |
upgrades.plumbing | Plumbing Upgrade | Boolean |
upgrades.heating | Heating Upgrade | Boolean |
policyNumber | Current insurance policy number | String |
insurerName | Name of current insurance | String |
agentFirstName | Insurance agent first name | String |
agentLastName | Insurance agent last name | String |
agentEmail | Insurance agent email | String |
retired | Are you retired (True/False) | Boolean |
isSpecialOccupation | Is Occupation (Teacher, Military, First Responder) | Boolean |
loyalty | Discount earned for being with the same insurer for a pre-determined period of time | Integer |
claimFree | Claim free for a pre-defined number of consecutive years | Integer |
mortgageFreeAndLienFree | Discount earned if mortgage is paid off in full and there is no lien on the property (True/False) | Boolean |
isGated | Gated Community | Boolean |
isSmokingFree | Smoke Free (non smokers) | Boolean |
didSubmitDiscount | Confirmation user submitted discount | Boolean |
canProvidePhotoCertificate | User can provide photo | Boolean |
policyAmount | Amount User pays for policy | String |
policyExpirationMonth | What month does your policy end? (january, feburary, etc..) | String |
insurerId | Insurance Id | String |
partnerUserCreateTime | UTC ISO_8601 | String |
Yearly |
Monthly |
YYYY-MM-DD |
Married |
Single |
High School |
College |
Graduate Degree or higher |
Quote
After successfully creating a user, you may start the insurance quote process. This is done by passing in a user ID and type of insurance quote to our quote endpoint. Currently, we only provide home insurance quotes. The response object will contain a status and quote ID. Our servers will then process the information and attempt to generate a quote for the user. We will deliver a webhook payload containing the user and quote ID once the quote process has been completed.
Generate Quote IDs
Starts the insurance quote process. Pass in the user ID and type of insurance. Dory will generate IDs for the quotes and return the ID and status of each quote.
0 | home insurance |
pending | Quote is in the process of being completed |
success | Quote process is finished and details can be fetched |
failure | Quote was not generated for the user |
expired | The quote is no longer valid and the process needs to be restarted |
curl --location --request POST '/quote/v1' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId": "wd4kZcAw1648147055",
"type": 0
}'
require "uri"
require "json"
require "net/http"
url = URI("/quote/v1")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"userId": "wd4kZcAw1648147055",
"type": 0
})
response = http.request(request)
puts response.read_body
var axios = require('axios');
var data = JSON.stringify({
"userId": "wd4kZcAw1648147055",
"type": 0
});
var config = {
method: 'post',
url: '/quote/v1',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
[
{
"quoteId": "xErFgC1648745126",
"userId": "wd4kZcAw1648147055",
"status": "pending",
"createdAt": "2020-07-10 15:00:00.000"
}
]
HTTP Request:
POST
/quote/v1
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Output Schema of Request
Field | Description | Required | Type |
---|---|---|---|
userId | ID of the User | Yes |
String |
type | Type of the User | No |
Integer |
Get All Quotes
Get list of all available quotes.
curl --location --request GET '/quotes/v1/QY7Ndf8Ng1ge50hvej' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--data-raw ''
require "uri"
require "net/http"
url = URI("/quotes/v1/QY7Ndf8Ng1ge50hvej")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
response = http.request(request)
puts response.read_body
var axios = require('axios');
var data = '';
var config = {
method: 'get',
url: '/quotes/v1/QY7Ndf8Ng1ge50hvej',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"quotes": [
{
"id": "QY7Ndf8Ng1ge50hvej",
"createAt": "2022-09-29T16:16:28Z",
"type": 0,
"offerUrl": "https://staging-apiv1.getdory.dev/quote/v1/QY7Ndf8Ng1ge50hvej/offer",
"insurerName": "Roo Insurance",
"userId": "u4J78bPC1ge50cvan",
"validFor": 1, // Days
"price": 12,
"period": 52, // Weeks
"discount": 5,
"status": "success"
}
]
}
HTTP Request:
GET
/quotes/v1/:userId
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Output Schema of Request
Field | Description | Required | Type |
---|---|---|---|
userId | User Id from create User | Yes |
String |
Get Quote Details
Retrieve details about a quote. Until the quote processing webhook is delivered, the only information about the quote that will be available will be the “status” property
curl --location --request GET '/quote/v1/xErFgC1648745126' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2oxMzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8' \
--data-raw ''
require "uri"
require "net/http"
url = URI("/quote/v1/xErFgC1648745126")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8"
response = http.request(request)
puts response.read_body
var axios = require('axios');
var data = '';
var config = {
method: 'get',
url: '/quote/v1/xErFgC1648745126',
headers: {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVySWQiOiIyMDU3Iiwia2V5SWQiOiJqa2ox
MzEyMyIsImV4cCI6MTUxNjIzOTAyMn0.JCCAbNW4O5RSoGrSbvpF78VtjJ5gxJTuob_69Bn4cW8'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
The above command returns JSON structured like this:
{
"id": "xErFgC1648745126",
"createdAt": "2020-07-10 15:00:00.000Z",
"updatedAt": "2020-07-10 17:00:00.000",
"userId": "wd4kZcAw1648147055",
"insurerName": "Roo Insurance",
"discount": 150.00,
"offerUrl": "insure.heymeetdory/com/offer/xErFgC1648745126",
"price": 1900,
"status": "success",
"type": 0,
"period": 52, // Weeks
"validFor": 60, // Days
}
HTTP Request:
GET
/quote/v1/:id
Headers
Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Output Schema of Request
Field | Description | Required | Type |
---|---|---|---|
Id | Quote id Generated | Yes |
String |
Webhooks
You will supply us with a destination url to deliver Dory’s quote webhook to. Once our system has processed the quote, we will send a small payload containing the quote ID, user ID and its status. Once you have received this webhook, you may proceed to fetch the details of that quotes.
{
"quotes": [
{
"id":"xErFgC1648745126",
"userId": "wd4kZcAw1648147055",
"status": "success",
"createdAt": "2020-07-10 15:00:00.000",
"updatedAt": "2020-07-11 17:00:00.000",
}
]
}
Errors
The Dory API uses the following error codes and messages. Some error responses contain an internal error code. If you receive one of these and are unclear about its accompanying message, reach out to your solutions architect.
400
- Failed to create quote
- Invalid Parameter: You must provide a userId
- User’s address is not covered
- No offer available
401
- Authentication code is required
- Invalid key
- Authentication code must valid for less than 2 hours
- The JWT has expired
404
- User does not exist
- Address not found
- Failed to create quote