eWebRenter Quick-Quote Plugin Documentation

The Quick-Quote feature relies on a straight-forward, RESTful API to "post" form data to the servers at Dealership Software. You would invoke the API from your existing "contact form" page, perhaps via Javascript. Each time a successful post occurs, a new quote request is generated, and appears in your eWebRenter dashboard. A new customer will be generated unless the user's email and last name match an existing customer, in which case the existing customer's information will be used and updated as necessary.


Resource URL

https://online.ewebrenter.com/quote/request

Resource Information

Response format: text/plain

Requires authentication: CORS-based access control


Result

Success: "ok"

Failure: Error code


jQuery plugin code

A sample javascript (a jQuery plugin) is available that you can add to your existing "contact form" page. The plugin makes use of the jQuery Validation plugin to validate all supported form fields prior to submission. You may customize the code to your environment.

Below is a snippet of the Ajax call used in the plugin. Essentially, the plugin code will "intercept" the form submit event, send the form data to the server, then continue with the default form processing.

You can call your current default form processing after the Ajax call returns, perhaps adjusting the behavior based on the returned data (e.g., success or failure). Or, you can simply always call the default form processing by placing the form.submit() call in the Ajax .always() clause. In either case, you should continue to email/text the form information to your sales team as you normally would. In this way, if there is a failure somewhere, then at least either your default form processing, or the eWebRenter processing will have captured the customer's order.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Asynchronous call to send the data for remote storage
$ .ajax({
url   : "https://online.ewebrenter.com/quote/request",
method: "POST",
data  : form_data,  // JSON object - see Supported form data fields below
dataType :     "text"
})
.done(function(data){

// Returns "ok" on success, otherwise an error code
console.log(data);

})
.fail(function(jqXHR, textStatus, errorThrown){

// Locally log error to help client debug
console.log("Request failed: " + textStatus + ' ' + errorThrown);
})
.always(function(){

// To continue with original form submit() processing, regardless of 
// success/failure of submission, uncomment the following form.submit(); 
// Comment out for viewing ajax return code during test.
form.submit();
});

Supported form data fields

The quote/request API is expecting a single, flat JSON object composed of field names and their corresponding values, e.g.,

var form_data = {
  dealership_name : dealership_name,
  dealership_id : dealership_id,
  location_id : location_id,
  lead_source : lead_source,
  firstname : firstname,
  ...
}


The table below lists the supported field names, along with a brief description, the recommended type for HTML form usage, whether or not the field is required by the API, and additional notes, such as accepted values, min/max value lengths, etc.

There are only a few fields that are required by the plugin; in particular, database look-ups depend on the email and last name. Submitting only the required fields, however, tends to lessen the usefulness of the plugin. That is, since the point is to reduce double-entry, you are encouraged to make use of as many of the recommended fields as is feasible for your situation.

The HTML 'name' tags used on form field may be anything you wish, as long as the values are bound to the expected field names when creating the JSON object. That is, if the name tag for the HTML "First name" text field is "first_name", then the Javascript could contain something like:

var firstname = $("input[name='first_name']").val();

Fields (static) typically hard-coded into Javascript:
Field name Description Type Required? Notes
dealership_name Your dealership's name text Yes Given to you by Dealership Software
dealership_id Your dealership's id number Yes Given to you by Dealership Software
location_id Your dealership's location id number Yes Given to you by Dealership Software. Use a select attribute for multiple locations
lead_source Informational tag to use when quote generated via this plugin text Recommended E.g., 'website'; Max: 255
Fields (dynamic) typically maintained in the HTML form:
Field name Description Type Required? Notes
firstname Customer's first name text Recommended Min: 2, Max: 100
middlename Customer's middle name text No Max: 50
lastname Customer's last name text Yes Min: 2, Max: 100
email Customer's email email Yes Max: 150
email2 Customer's email for confirmation email No Used for confirmation only
home_phone Customer's phone text Recommended Min: 10, Max: 30
address_1 Customer's street address text Recommended Min: 2, Max: 100
address_2 Customer's additional street address text No Suite, Apt., etc. Max: 100
city Customer's city text Recommended Min: 2, Max: 100
state Customer's state text Recommended Min: 2, Max: 100
postcode Customer's zip/post code text Recommended Min: 5, Max: 30
country Customer's country text No Max: 100
business_name Name of customer's business text No Max: 100
class_id Short description of customer's desired vehicle type(s) text Recommended Include length, e.g., '28 ft Class C'; Max: 100; Use a multi-select attribute
pickup_date Date or DateTime of vehicle pick-up Date or DateTime Recommended E.g., 10/9/2016 9:00 am;
dropoff_date Date or DateTime of vehicle drop off Date or DateTime Recommended E.g., 10/9/2016 9:00 am
estimatedmiles Estimated number of round-trip miles number Recommended Min: 0, Max: 9999
destination Customer's desired destination text Recommended Min: 2, Max: 100
numadults Number of participating adults number Recommended Min: 1, Max: 200
numchildren Number of participating children number Recommended Max: 100
comments Customer's questions/comments text Recommended Max: 1200
contacttypepref Preferred means of contact text Recommended Phone, Email, Text; Use a select attribute.
contacttimepref Preferred time of contact text Recommended Morning, Afternoon, Evening; Use a select attribute.
advertsource How customer heard about you text Recommended Must match eWebRenter advertising sources; Use a select attribute.