2017 © Pedro Peláez
 

library jotform-api-php-client

JotForm API Client Library for PHP

image

rawswift/jotform-api-php-client

JotForm API Client Library for PHP

  • Monday, June 19, 2017
  • by rawswift
  • Repository
  • 1 Watchers
  • 1 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

JotForm API Client Library for PHP

Description

A simple JotForm API library for PHP., (*1)

Requirements

Installation

The recommended way to install jotform-api-php-client is through Composer., (*2)

curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install jotform-api-php-client library:, (*3)

php composer.phar require ryanyonzon/jotform-api-php-client:dev-master

After installing, simply include the Composer's autoloader (inside your script):, (*4)

require 'vendor/autoload.php';

Examples

A simple example to get user's information:, (*5)

<?php
require 'vendor/autoload.php';

$key = 'your-jotform-api-key-here';

$client = new JotForm\JotFormClient();
$client->setAPIKey($key);

$user = new JotForm\Resource\User($client);

try {
    $info = $user->getUser();
    print_r($info);
} catch (\JotForm\Exception\ClientException $e) {
    echo $e->getMessage() . "\n";
}

Here's another example for creating a form:, (*6)

<?php
require 'vendor/autoload.php';

$key = 'your-jotform-api-key-here';

$client = new JotForm\JotFormClient();
$client->setAPIKey($key);

$form = new JotForm\Resource\Form($client);

try {
    $myForm = [
        'questions' => [
            [
                'type' => 'control_head',
                'text' => 'Form Title',
                'order' => 1,
                'name' => 'Header'
            ],
            [
                'type' => 'control_textbox',
                'text' => 'Text Box Title',
                'order' => 2,
                'name' => 'TextBox',
                'validation' => 'None',
                'required' => 'No',
                'readonly' => 'No',
                'size' => 30,
                'labelAlign' => 'Auto',
                'hint' => 'Hint: Lorem Ipsum'
            ],
        ],
        'properties' => [
            'title' => 'My Form',
            'height' => 600
        ],
        'emails' => [
            'type' => 'notification',
            'name' => 'notification',
            'from' => 'default',
            'to' => 'noreply@mywebsite.com',
            'subject' => 'New Submission',
            'html' => 'false'
        ]
    ];
    $response = $form->createForm($myForm);
    print_r($response);
} catch (\JotForm\Exception\ClientException $e) {
    echo $e->getMessage() . "\n";
}

See examples folder for more sample scripts., (*7)

License

Licensed under the MIT license, (*8)

The Versions

19/06 2017

dev-master

9999999-dev

JotForm API Client Library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ryan Yonzon

api php library client jotform