PHP code example of form-synergy / php-api

1. Go to this page and download the library: Download form-synergy/php-api 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/ */

    

form-synergy / php-api example snippets




\FormSynergy\Session::enable();

use \FormSynergy\Fs as FS;

FS::Config([
    'version' => 'v1',
    'protocol' => 'https',
    'endpoint' => 'api.formsynergy.com',
    'apikey' => $apikey,
    'secretkey' => $secretkey,
    'max_auth_count' => 15,
]);

FS::Storage( '/', 'local-storage' );

$api = FS::Api()->Load($profileid);

$api->Create('website')
    ->Attributes([
        'name' => 'MyWebsite',
        'domain' => 'example.website.ltd',
        'proto' => 'https://'
    ])
    ->As('website');

<meta name="fs:siteid" content=" echo $api->_website('siteid');

$api->Get('website')
    ->Where([
        'siteid' => $api->_website('siteid')
    ])
    ->verify();

$api->Create('strategy')
    ->Attributes([
        'name' => 'Default strategy',
        'siteid' => $api->_website('siteid')
    ])
    ->As('defaultStrategy');
bash
composer