PHP code example of powerforms / apiclient

1. Go to this page and download the library: Download powerforms/apiclient library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

powerforms / apiclient example snippets


// create client with configuration above
$client = new \powerforms\apiclient\Client($baseApiUrl, $apiKey, $apiSecret);

// get all available Forms
$forms = $client->getForms();

// get all data states
$states = $client->getDataStates();

// get data from 1.1.2016 for form #1
$data = $client->getData(1, '2016-01-01'); 

// get count and data from 1.1.2016 to 10.3.2016 for form #1 and #2 where state is OK 
$countData = $client->getDataCount([1,2], '2016-01-01', '2016-03-10',['OK']);
$data = $client->getData([1,2], '2016-01-01', '2016-03-10',['OK']);



bash
# Install Composer
curl -sS https://getcomposer.org/installer | php