The new DrillerDB is out of beta.See what's new

Quote Request Endpoint

Send a homeowner's quote request from your own website into DrillerDB, with an address, GPS pin, or a township, range and section legal description

Quote Request Endpoint

Your own website can send a quote request straight into DrillerDB. It is the same endpoint the DrillerDB contractor directory uses for its Request a Quote form, so a request from your site lands exactly where a directory request does: the contractor is emailed, the homeowner gets a confirmation, and a linked DrillerDB account sees the request in its quote queue.

This page shows you how to send one, and how to describe the job site when the homeowner has a legal description instead of a street address.

Quick Start

  1. Find your directory listing id. It is the company_id your DrillerDB directory page uses for its quote form. If you do not know it, ask support@drillerdb.com and we will send it.
  2. Send a POST to https://app.drillerdb.com/api/ with a JSON body and Content-Type: application/json.
  3. Put "request": "submitQuote" in the body, plus the required fields below.
  4. Read response in the reply. success means the quote is stored and the contractor has been notified. fail means nothing was stored, and field names the input to fix.

No sign-in and no API key is needed. The endpoint is public because homeowners use it from a browser.

The request

{
  "request": "submitQuote",
  "company_id": 12345,
  "drillerEmail": "office@yourcompany.com",
  "firstName": "Pat",
  "lastName": "Homeowner",
  "userEmail": "pat@example.com",
  "phone": "555-555-0100",
  "currentAddress": "123 Main St, Guymon, OK 73942",
  "requestType": "New Well",
  "projectDetails": "Looking for a new domestic well on our acreage.",
  "isDifferentLocation": true,
  "serviceLocationText": "Family land north of town",
  "serviceTownship": "5",
  "serviceTownshipDir": "N",
  "serviceRange": "12",
  "serviceRangeDir": "E",
  "serviceSection": "14",
  "serviceQuarter1": "NW",
  "serviceQuarter2": "SE",
  "serviceState": "OK",
  "serviceCounty": "Texas"
}

Required fields

FieldWhat the server checksMessage when it fails
company_idA positive whole number, your directory listing idQuote form is missing a valid company.
drillerEmailA valid email address for your officeQuote form is missing a valid contractor email.
firstNameNot emptyPlease enter your first name.
lastNameNot emptyPlease enter your last name.
currentAddressNot empty. The homeowner's project or billing addressPlease enter the project or billing address.
userEmailA valid email address for the homeownerPlease enter a valid email address.
phoneAt least 7 digits once punctuation is removedPlease enter a valid phone number.
requestTypeNot emptyPlease choose a request type.

The server checks them in that order and stops at the first failure, so a reply names one field at a time.

Request type

The directory form offers New Well, Well Reconstruction, Pump Work, Service / Repairs Only and Other. The server accepts any text here. Only one value changes what happens next: a request type containing New Well starts a geology estimate for the job site, provided the site resolved to a location. Every other type is stored without one.

What the directory form does with the type

On a driller's directory listing, the form opens on a request type that the listing offers. It picks the first of New Well, Pump Work, Service / Repairs Only, and Well Reconstruction that the listing lists, or Other when it lists services but none of these. A listing with no services listed at all opens on New Well. A listing that offers only pump and service work no longer opens on New Well.

If a homeowner picks a type the listing does not list, the form adds a short note, for example "Lakeside Pump Service does not list new well drilling", with a link to find drillers who do. The note does not stop the homeowner from sending the request.

When the listing cannot take the request itself, the form offers nearby drillers to send it to:

  • A driller whose listed services match the chosen type starts ticked.
  • A driller that lists other services only is greyed out and cannot be ticked. It reads, for example, "Does not list new well drilling".
  • A driller with no services listed can be ticked but never starts ticked. It reads "Services not listed". DrillerDB cannot tell what such a driller offers, so the homeowner decides.
  • Changing the request type updates the ticks. When no nearby driller matches, the form says "None of these drillers list" the chosen service and links to Find drillers who do.

DrillerDB checks this again when the request is sent. It does not send the request to a ticked driller whose listed services do not offer the type, and it does not name that driller in the reply. A request type outside the form's five is not filtered. Your own website's form is not affected.

Optional fields

FieldUse
projectDetailsFree text from the homeowner
isDifferentLocationtrue when the job site is not the address above. When it is true, send serviceLocationText, or serviceLat and serviceLng, or the server refuses with "Please enter the service location."
serviceLocationTextThe job site as the homeowner wrote it
serviceLat, serviceLngA GPS pin for the job site, as decimal degrees. A pin you send is used as-is
currentAddressJson, serviceLocationJsonA Google Places result for either address, if your form collects one. Stored with the request
serviceTownship ... serviceCountyA legal description of the job site. See below
honeypotLeave it out, or send it empty. It is a spam trap for forms. A request with any value in honeypot is refused: the reply carries "code": "REFUSED" and the error "Your request could not be sent. Please call the contractor directly." Nothing is stored and nobody is emailed

Many rural job sites have no street address. The endpoint accepts a Public Land Survey System description instead, and turns it into a map pin on the server.

  1. Collect the township, township direction, range, range direction and section. All five travel together. Send four of the five and the server ignores the description entirely and stores the request with no location.
  2. Add the quarter sections if the homeowner has them. serviceQuarter1 is the quarter of the section and serviceQuarter2 the quarter of that quarter, so NW then SE reads as the SE quarter of the NW quarter.
  3. Send serviceState as the two-letter state code. The state chooses the survey meridian. If you leave it out, the server uses your own company's state.
  4. Send serviceCounty whenever you have it. Some states are surveyed from more than one meridian, and the county is what picks between them. In Oklahoma the Panhandle counties (Cimarron, Texas and Beaver) are surveyed from the Cimarron meridian while the rest of the state uses the Indian meridian, so a Panhandle description sent without its county resolves to the wrong place. A county the server does not recognise is not an error: the description falls back to the state's default meridian, exactly as if no county had been sent.
FieldAccepted values
serviceTownshipA whole number from 1 to 200
serviceTownshipDirN or S
serviceRangeA whole number from 1 to 200
serviceRangeDirE or W
serviceSectionA whole number from 1 to 36
serviceQuarter1, serviceQuarter2NE, NW, SE or SW, or leave out
serviceStateTwo-letter state code, or leave out to use your company's state
serviceCountyThe county name, with or without the word County

Letters are accepted in either case. A value outside its range is refused with a reason such as "section out of range 1-36" or "townshipDir must be N or S". When a legal description is refused, the quote is still stored; it just has no location, and a New Well request then gets no geology estimate.

How the server chooses the job-site location

The server tries three sources in a fixed order and stops at the first one that produces a pin:

  1. A pin you sent in serviceLat and serviceLng.
  2. One geocode of serviceLocationText when you sent one, otherwise of currentAddress. The choice is by presence only: this step does not read isDifferentLocation, so a serviceLocationText you send is geocoded even when that flag is false.
  3. The legal description.

So a request that carries both a street address and a legal description never uses the legal description unless the address failed to geocode. Send the legal description alone when it is the better source.

Two refusals apply to a legal description that did convert:

  • Too far from you. A pin more than 500 miles from your company's own location is treated as a wrong-place match and dropped. That exists to catch a description resolved against the wrong meridian, which is why serviceCounty matters.
  • Unverified. When the survey lookup cannot find the section and only a mathematical estimate is available, the pin is dropped rather than stored. An estimate from a meridian anchor is not a verified location.

In both cases the quote is still stored and you are still notified. The request simply arrives without a map pin, and you can add one when you open it.

The reply

A stored quote answers response: "success" in one of two shapes, and the shape depends on geologyStatus. Code against both.

Every request type except a New Well with a location (geologyStatus is not_applicable, or no_location when no pin could be resolved). The contractor is emailed at once, and the reply says whether that email went out:

{
  "response": "success",
  "quoteId": 98765,
  "confirmationSent": true,
  "contractorEmailSent": true,
  "geologyStatus": "not_applicable",
  "message": "Quote submitted successfully. Contractor has been notified.",
  "drillerdb_sync": "skipped",
  "drillerdb_proposal_id": null,
  "drillerdb_workorder_id": null,
  "approval_status": null,
  "driller_unreachable": null
}

A New Well request with a location (geologyStatus is pending). The contractor's email waits for the geology estimate, so this shape has no contractorEmailSent key at all and a different message. Do not read contractorEmailSent as false here; it is absent:

{
  "response": "success",
  "quoteId": 98766,
  "confirmationSent": true,
  "geologyStatus": "pending",
  "message": "Quote submitted successfully. Contractor will be notified shortly.",
  "drillerdb_sync": "skipped",
  "drillerdb_proposal_id": null,
  "drillerdb_workorder_id": null,
  "approval_status": null,
  "driller_unreachable": null
}

confirmationSent says whether the homeowner's confirmation email went out. drillerdb_sync, the two ids and approval_status describe what happened inside a linked DrillerDB account; they are skipped and null for a listing that is not linked to an account.

When the listing cannot receive the request

If DrillerDB already knows nobody at the listing can get the request, for example the listing has no working email address or has opted out of requests through DrillerDB, the request is still saved. driller_unreachable is then an object and message is its text, written for the homeowner, in place of "Contractor has been notified." or "Contractor will be notified shortly." Show text to the homeowner as it is.

KeyWhat it holds
kindcannot_email or opted_out
variantA short code for the wording that was chosen
textThe sentence for the homeowner, with the next step
phoneThe listing's phone number when it has one to show, otherwise null
drillersNearby drillers to try instead, each with name, city, state, miles and a profile url. Empty for a paying listing
directory_urlA link to the find-a-driller directory when there are no nearby drillers to list, otherwise null
promisetrue when DrillerDB will email the homeowner within one business day

A held request

DrillerDB can hold a request for a short manual check before anyone is emailed. The reply to your form is still a success, with no quoteId:

{
  "response": "success",
  "confirmationSent": false,
  "contractorEmailSent": false,
  "message": "Your request has been received."
}

Nothing is emailed to the homeowner or the contractor until the check is done. Do not send the request again to get past the check.

A resend of the same request

If your form sends the same request again within 15 minutes, DrillerDB does not store it or email anyone a second time. "The same" means the same company_id, userEmail, projectDetails and requestType, with a missing message or type read as empty. The reply is a success that points at the quote already saved:

{
  "response": "success",
  "quoteId": 98765,
  "confirmationSent": false,
  "geologyStatus": "not_applicable",
  "message": "Quote submitted successfully. Contractor has been notified.",
  "drillerdb_sync": "skipped",
  "drillerdb_proposal_id": null,
  "drillerdb_workorder_id": null,
  "approval_status": null,
  "driller_unreachable": null,
  "duplicate_of": 98765,
  "contractorEmailSent": true
}
  • duplicate_of is present only on a resend, and holds the saved quote's id (the same as quoteId).
  • confirmationSent is false because nothing new was emailed.
  • geologyStatus, message, contractorEmailSent and the account fields are read from the saved quote. contractorEmailSent is present only when geologyStatus is not_applicable or no_location, as on a first send.
  • A first request whose contractor email failed, bounced or was rejected is not matched. Sending it again stores and emails a new quote.

So a form that retries after a timeout can treat this reply as a success. To ask the same contractor for different work, change the message or the request type.

A validation failure looks like this, and nothing is stored:

{
  "response": "fail",
  "field": "phone",
  "error": "Please enter a valid phone number.",
  "message": "Please enter a valid phone number."
}

Troubleshooting

The reply says "Quote form is missing a valid company." company_id is missing, zero, or not a number. It is your directory listing id, not your DrillerDB account number. Ask support if you are unsure which id to use.

The request arrived with no map pin. Either the address did not geocode, or the legal description was incomplete, out of range, too far from your company, or could not be verified. Send serviceLat and serviceLng when your form can collect a pin, and always include serviceCounty with a legal description.

A Panhandle job site landed in the wrong part of the state. Add serviceCounty. Without it, an Oklahoma description resolves from the Indian meridian.