Beta

Overview

The examples in this guide send HTTP requests that create different types of leads and get pre-qualification results.

This example sends a HTTP request to the leads endpoint using the cUrl tool.

curl -X POST https://webapi.guidantfinancial.com/json/leads -u 'username:password' -d '{"cid":"your_cid_here","lead_type":"standard","first_name":"test","last_name":"test","phone":"5555555555","email":"email@website.com"}' -H "Content-Type: application/json"

Formatted version of the JSON string:

{
    "cid": "your_cid_here",
    "lead_type": "standard",
    "first_name": "test",
    "last_name": "test",
    "phone": "5555555555",
    "email": "email@domain.com"
}

Response:

{
    "id": "returned_lead_id"
}

This example creates a pre-qualification lead and passes more data in the JSON string.

curl -X POST https://webapi.guidantfinancial.com/json/leads -u 'username:password' -d '{"cid":"your_cid_here","lead_type": "prequalification","first_name":"test","last_name":"test","email":"email@domain.com","phone":"5555555","credit_score":"Above 720","bankruptcy":false,"retirement":10000,"cash":25000,"investments":5000}' -H "Content-Type: application/json"

Formatted version of the JSON string:

{
    "cid": "your_cid_here",
    "lead_type": "prequalification",
    "first_name": "test",
    "last_name": "test",
    "email": "email@domain.com",
    "phone": "5555555",
    "credit_score": "Above 720",
    "retirement": 10000,
    "cash": 25000,
    "investments": 5000
}

Response:

{
    "id": "returned_lead_id"
}

This example sends a HTTP request to the leads/<id> endpoint using the cUrl tool.

curl -X GET https://webapi.guidantfinancial.com/json/leads/lead_id_here -u 'username:password'"

Response:

{
    "first_name": "John",
    "rollover_amount": 30000,
    "sba_qualified_amount": 150000,
    "unsecured_amount": 150000,
    "portfolio_loan_qualified_amount": 0,
    "total_qualified_amount": 195000
}

This example sends a HTTP request to the leads endpoint using PHP.

...
$metadata = array(
    "cid"         => "your_cid_here",
    "first_name"  => "john",
    "last_name"   => "adams",
    "phone"       => "555-555-5555",
    "email"       => "john@somedomainname.com"
);
$metadata_json = json_encode($metadata);
$hash = base64_encode("username:password");
$curl_instance = curl_init();
curl_setopt($curl_instance, CURLOPT_URL, "https://webapi.guidantfinancial.com/json/leads");
curl_setopt($curl_instance, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Basic " . $hash));
curl_setopt($curl_instance, CURLOPT_POST, 1);
curl_setopt($curl_instance, CURLOPT_POSTFIELDS, $metadata_json);
$response = curl_exec($curl_instance);
curl_close($curl_instance);
...

Response:

{
    "id": "returned_lead_id"
}

This example creates a pre-qualification lead and passes more data in the JSON string.

...
$metadata = array(
    "cid"           => "your_cid_here",
    "lead_type"     => "prequalification",
    "first_name"    => "john",
    "last_name"     => "adams",
    "phone"         => "555-555-5555",
    "email"         => "john@somedomainname.com",
    "credit_score"  => "680 - 720",
    "retirement"    => 256000,
    "cash"          => 32000,
    "investments"   => 128000
);
$metadata_json = json_encode($metadata);
$hash = base64_encode("username:password");
$curl_instance = curl_init();
curl_setopt($curl_instance, CURLOPT_URL, "https://webapi.guidantfinancial.com/json/leads");
curl_setopt($curl_instance, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Basic " . $hash));
curl_setopt($curl_instance, CURLOPT_POST, 1);
curl_setopt($curl_instance, CURLOPT_POSTFIELDS, $metadata_json);
$response = curl_exec($curl_instance);
curl_close($curl_instance);
...

Response:

{
    "id": "returned_lead_id"
}

This example sends a HTTP request to the leads/<id> endpoint using PHP.

...
$lead_id = 'lead_id_here';
$hash = base64_encode("username:password");
$curl_instance = curl_init();
curl_setopt($curl_instance, CURLOPT_URL, "https://webapi.guidantfinancial.com/json/leads/" . $lead_id);
curl_setopt($curl_instance, CURLOPT_HTTPHEADER, array("Authorization: Basic " . $hash));
curl_setopt($curl_instance, CURLOPT_RETURNTRANSFER, 1 );
$response = curl_exec($curl_instance);
curl_close($curl_instance);
...

Response:

{
    "first_name": "John",
    "rollover_amount": 30000,
    "sba_qualified_amount": 150000,
    "unsecured_amount": 150000,
    "portfolio_loan_qualified_amount": 0,
    "total_qualified_amount": 195000
}

This example sends a HTTP request to the leads endpoint using C#.

  ...
  using System.Web.Script.Serialization;
  ...
  using (var webClient = new WebClient())
  {
      var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("username:password"));
      webClient.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
      webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
      var data = new JavaScriptSerializer().Serialize(
          new Dictionary<string, string>
          {
              ["cid"] = "your_cid_here",
              ["first_name"] = "john",
              ["last_name"] = "adams",
              ["phone"] = "555-555-5555",
              ["email"] = "john@somedomainname.com",
          });
      var result = webClient.UploadString("https://webapi.guidantfinancial.com/json/leads", data);
  }
  ...
          

Response:

{
    "id": "returned_lead_id"
}
          

This example creates a pre-qualification lead using C#.

  ...
  using System.Web.Script.Serialization;
  ...
  using (var webClient = new WebClient())
  {
      var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("username:password"));
      webClient.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
      webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
      var data = new JavaScriptSerializer().Serialize(
          new Dictionary<string, string>
          {
              ["cid"] = "your_cid_here",
              ["lead_type"] = "prequalification",
              ["first_name"] = "john",
              ["last_name"] = "adams",
              ["phone"] = "555-555-5555",
              ["email"] = "john@somedomainname.com",
              ["credit_score"] = "680 - 720",
              ["retirement"] = "256000",
              ["cash"] = "32000",
              ["investments"] = "128000"
          });
      var result = webClient.UploadString("https://webapi.guidantfinancial.com/json/leads", data);
  }
  ...
          

Response:

{
    "id": "returned_lead_id"
}
          

This example sends a HTTP request to the leads/<id> endpoint using C#.

  ...
  using (var webClient = new WebClient())
  {
      var leadId = "lead_id_here";
      var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes("username:password"));
      webClient.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
      webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
      var result = webClient.DownloadString($"https://webapi.guidantfinancial.com/json/leads/{leadId}");
  }
  ...
          

Response:

  {
    "first_name": "John",
    "rollover_amount": 30000,
    "sba_qualified_amount": 150000,
    "unsecured_amount": 150000,
    "portfolio_loan_qualified_amount": 0,
    "total_qualified_amount": 195000
  }