I have a client that wants to integrate Jotform with their API

  • andrewtagmarketingcoza
    Asked on June 29, 2017 at 1:10 PM

    I have a client that wants the lead details i collect directly submitted into there API.  I have no idea how to do this.  Can you assist.

  • aubreybourke
    Replied on June 29, 2017 at 1:19 PM

    What API do they use? 

  • andrewtagmarketingcoza
    Replied on June 29, 2017 at 1:44 PM
    Hi,

    Thanks for the response

    Please see below. Its all greek to me. This is what I received from them

    You can add this to your page template or functions.php and add your css classes to the form code below:

    function html_form_code() {
    $url = “insert return url here”;
    $kpcid = ’add kpcid here’;
    $action = $_SERVER['PHP_SELF'];
    echo '';
    echo '
    ';
    echo '
    ';
    echo '
    ';
    echo '';
    echo '
    ';
    echo '
    ';
    echo '';
    echo '
    ';
    echo '

    ';
    echo '';
    echo '

    ';
    echo '';
    }
    //Detect the fields posted
    if (isset($_POST["telephone"]) && isset($_POST["FullName"]))
    {
    try
    {
    $name = $_POST["FullName"];
    $contact = $_POST["telephone"];
    /*This is the live url : please replace with the test link when you deploy to production
    http://ws.kingprice.co.za/kpws/WebServices/Cavalry/Outbound/LeadsService.asmx?wsdl
    */
    $client = new SoapClient(" http://ws.kingprice.co.za/prews/WebServices/Cavalry/Outbound/LeadsService.asmx?WSDL");
    $lead = array(
    'bucket' => array(
    'FirstName' => $name,
    'surname' => '',
    'IsBroker' => '0',
    'Mobile' => $contact,
    'Email' => '',
    'KPcID' => ‘add kpcid here’,
    'ref' => 'SHP',
    'PartnerID' => '',
    'DateCaptured' => date('c'),
    'GenRef' => '',
    'sOwnerID' => '',
    'sBucket_Group' => '',
    'BucketKey' => '',
    'DOB' => '1900-01-01',
    'DateUpdated' => '1900-01-01',
    'GenRef' => '',
    'LMSUserID' => '',
    'LMSGroup_ID' => '',
    'Calc_Priority' => '',
    'ContactTries' => '',
    'Username' => '',
    'Password' => '',
    'Referer' => '',
    'LeadOriginator' => '',
    'SortSeq' => '',
    'strHostName' => $_SERVER["REMOTE_HOST"],
    'intUser' => '',
    'gender' => 'M',
    'Comments' => '',
    )
    );

    $success = $client->AddLead($lead);
    echo $success->AddLeadResult->ReferenceNum;
    $status = 1;

    // If status is successful
    if (isset ($success->AddLeadResult->Success) && $success->AddLeadResult->Success == 1 &&
    isset ($success->AddLeadResult->ReferenceNum) && $success->AddLeadResult->ReferenceNum)
    {
    // Successful
    header ("location: http://www.autotradersites.co.za/FORMS/kingprice/");
    exit();
    }
    else
    {
    // Fail status
    $status = 0;
    }
    }
    catch (Exception $e)
    {
    // Log error
    error_log ("SOAP API error here: " . $e->getMessage());
    }
    }
    ?>

    Then anywhere in your page template you can call the function

    <?php html_form_code(); ?>




    Andrew E-Mail Signature 2016


    ...
  • Welvin Support Team Lead
    Replied on June 29, 2017 at 3:42 PM

    Please use this website to share the codes: https://pastebin.com/. I think the forum has omitted some part of it. Or, ask your client to use it and share you the link, share it here as well after. 

    Do you know if they are using their website for the API requests? Or if they are using a third party provider to submit the data? We need a sort of documentation on how to do it for services like us. If not, no problem. Just please share us the codes using Pastebin. Let's see if we can work it out. I think our Send Post can be used for this integration.

    https://www.jotform.com/help/51-How-to-Post-Submission-Data-to-Thank-You-Page 

  • andrewtagmarketingcoza
    Replied on July 3, 2017 at 9:43 AM
    Hi,

    I uploaded the API and then down loaded from Pastebin? Im not sure if this is correct. See attached.

    Regards

    Andrew E-Mail Signature 2016


    ...
  • Kiran Support Team Lead
    Replied on July 3, 2017 at 11:52 AM

    Unfortunately, the attachments from the reply email cannot be posted back on the forum. Once you have copied the code to PasteBin, you can share the PasteBin URL to us so that we can take a look. Also, please let us know the application that you want to send the form information to. 

    You may also consider downloading the full source code of the form so that you can add the code to it. If you are not comfortable with programming, you may also hire a programmer from Upwork or Freelancer to achieve your requirement.