Online Sales 360 Enquiry from Web Service

Top  Previous  Next

A Sales Enquiry can be created from a web service very easily.  

 

This uses a Transactional Web Service using a method name of WEBT_SALES_LEAD_CREATE and the following parameters :-

 

FirstName

Surname

Address1

Address2

Address3

Address4

Address5

Notes

Team

Email

Title

Telephone

WorkNo

MobileNo

MakeWanted

ModelWanted

NewUsed    - "New" or "Used"

ColourRequired

ChangeDate  "dd/mm/yy"

Budget

PxMake

PxModel

 

An example using curl is :-

 

curl --location --request POST 'https://services.dmservices.co.uk/DmsNavigator.NavigatorWebService.svc/CallProgExt' \

--data-raw '<request>

<apikey>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</apikey>

<sessionid>12345</sessionid>

<method>WEBT_SALES_LEAD_CREATE</method>

<parameters>

<Team>19</Team>

<Title>Mr</Title>

<FirstName>Simon</FirstName>

<Surname>Verona</Surname>

<Email>simonverona999@googlemail.com</Email>

<MobileNo>07777777777</MobileNo>

<Notes>This is a test enquiry</Notes>

</parameters>

</request>

'

 

 

 

An example of this in use in a web page can be seen in the following example - which is built using html and jquery.  The actual web page can be viewed at

 

web page example <html>
<head>
   <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
   <script>
       < !this accesses the url variables in the URL! >
           function getUrlVars() {
               var vars = {};
               var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) {
                   vars[key] = value;
               });
               return vars;
           }
   </script>
   <script>
       < !In the next
       function the * * _rendered - form_ * * is the id of the form(see the < form > tag) ! >
           $(document).ready(function() {
               $('#rendered-form').submit(function(event) {
                   event.preventDefault();
                   < !gets the data from the form! >
                       var Title = document.forms["rendered-form"].elements["Title"].value;
                   var FirstName = document.forms["rendered-form"].elements["First-Name"].value;
                   var Surname = document.forms["rendered-form"].elements["Surname"].value;
                   var Email = document.forms["rendered-form"].elements["Email"].value;
                   var Notes = document.forms["rendered-form"].elements["Note"].value;
                   < !the next line comes from the URL! >
                       var ApiKey = getUrlVars()["apikey"]
                   < !builds the URL and xml to post a sales lead
                   for example! >
                       var settings = {
                           "url": "https://staging-services.dmservices.co.uk/DmsNavigator.NavigatorWebService.svc/CallProgExt",
                           "method": "POST",
                           "timeout": 0,
                           "data": "<request><apikey>" + ApiKey + "</apikey><sessionid>12345</sessionid><method>WEBT_SALES_LEAD_CREATE</method><parameters><FirstName>" + FirstName + "</FirstName><Surname>" + Surname + "</Surname><Email>" + Email + "</Email><Notes>" + Notes + "</Notes><Team>1</Team></parameters></request>\r\n",
                       };
                   $.ajax(settings).done(function(response) {
                       alert("Submitted");
                   });
               });
           });
   </script>
   <title>Navigator Demonstration Sales lead creator</title>
</head>
<body>
   <img src="logo_navigator-193x65.jpg">
   <h1>Navigator Sales 360 Demonstration Contact Form</h1>
   <br>
   <form method="POST" id="rendered-form">
       <div class="rendered-form">
           <div class="fb-text form-group field-Title">
               <label for="Title" class="fb-text-label">Title</label>
               <input type="text" class="form-control" name="Title" id="Title">
           </div>
           <div class="fb-text form-group field-First-Name">
               <label for="First-Name" class="fb-text-label">First Name</label>
               <input type="text" class="form-control" name="First-Name" id="First-Name">
           </div>
           <div class="fb-text form-group field-Surname">
               <label for="Surname" class="fb-text-label">Surname</label>
               <input type="text" class="form-control" name="Surname" id="Surname">
           </div>
           <div class="fb-text form-group field-Email">
               <label for="Email" class="fb-text-label">Email Address</label>
               <input type="text" class="form-control" name="Email" id="Email">
           </div>
           <div class="fb-textarea form-group field-Note">
               <label for="Note" class="fb-textarea-label">Comments</label>
               <textarea type="textarea" class="form-control" name="Note" id="Note"></textarea>
           </div>
           <div class="fb-button form-group field-submit">
               <input type="submit" class="btn-default btn" name="submit" style="default" id="submit" value="submit" />
           </div>
       </div>
   </form>
</body>
</html>

 

 

Content loading

Content loaded

Add a comment. Use hash symbol to link a work item, exclamation