What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

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

    Asked by andrewtagmarketingcoza on June 29, 2017 at 01: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.

  • Profile Image
    JotForm Support

    Answered by aubreybourke on June 29, 2017 at 01:19 PM

    What API do they use? 

  • Profile Image

    Answered by andrewtagmarketingcoza on June 29, 2017 at 01: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


    ...
  • Profile Image
    JotForm Support

    Answered by Welvin on June 29, 2017 at 03: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 

  • Profile Image

    Answered by andrewtagmarketingcoza on July 03, 2017 at 09: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


    ...
  • Profile Image
    JotForm Support

    Answered by Kiran on July 03, 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.