2017 © Pedro Peláez
 

library jotform-api-php

image

jotform/jotform-api-php

  • Wednesday, January 17, 2018
  • by jotform
  • Repository
  • 37 Watchers
  • 18 Stars
  • 4,345 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 2 Open issues
  • 1 Versions
  • 8 % Grown

The README.md

jotform-api-php

JotForm API - PHP Client, (*1)

Installation

Install via git clone:, (*2)

    $ git clone git://github.com/jotform/jotform-api-php.git
    $ cd jotform-api-php

or, (*3)

Install via Composer package manager (http://getcomposer.org/), (*4)

composer.json, (*5)

    {
        "require": {
            "jotform/jotform-api-php": "dev-master"
        }
    }
    $ php composer.phar install

Documentation

You can find the docs for the API of this client at http://api.jotform.com/docs/, (*6)

Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at API section of My Account page., (*7)

Examples

Print all forms of the user, (*8)

getForms();
    
    foreach ($forms as $form) {
        print $form["title"];
    }

?>

Get submissions of the latest form, (*9)

getForms(0, 1, null, null);

        $latestForm = $forms[0];

        $latestFormID = $latestForm["id"];

        $submissions = $jotformAPI->getFormSubmissions($latestFormID);

        var_dump($submissions);

    }
    catch (Exception $e) {
        var_dump($e->getMessage());
    }
    
?>

Get latest 100 submissions ordered by creation date, (*10)

getSubmissions(0, 100, null, "created_at");

        var_dump($submissions);
    }
    catch (Exception $e) {
        var_dump($e->getMessage());
    }
    
?>

Submission and form filter examples, (*11)

 "239252191641336722",
                "created_at:gt" => "2013-07-09 07:48:34",
        );
        
        $subs = $jotformAPI->getSubmissions(0, 0, $filter, "");
        var_dump($subs); 
        
        $filter = array(
                "id:gt" => "239176717911737253",
        );
        
        $formSubs = $jotformAPI->getForms(0, 0, 2, $filter);
        var_dump($formSubs);
    } catch (Exception $e) {
            var_dump($e->getMessage());
    }
    
?>

Delete last 50 submissions, (*12)

getSubmissions(0, 50, null, null);

        foreach ($submissions as $submission) {
            $result = $jotformAPI->deleteSubmission($submission["id"]);
            print $result;
        }
    }
    catch (Exception $e) {
        var_dump($e->getMessage());
    }
    
?>

First the JotForm class is included from the jotform-api-php/JotForm.php file. This class provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error., (*13)

The Versions

17/01 2018

dev-master

9999999-dev http://api.jotform.com

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0