A PHP library to manage Form Synergy services.
composer require form-synergy/php-api
require '/vendor/autoload.php';
\FormSynergy\Session::enable();
use \FormSynergy\Fs as FS;
You will need to retrieve your credentials in the Form Synergy console.
Form Synergy Website: https://formsynergy.com/
- $profileid = '';
- $apikey = '';
- $apisecret = '';
If you are a reseller
- $resellerid = '';
FS::Config([
'version' => 'v1',
'protocol' => 'https',
'endpoint' => 'api.formsynergy.com',
'apikey' => $apikey,
'secretkey' => $secretkey,
'max_auth_count' => 15,
]);
Enable local storage to store downloads and responses.
FS::Storage( '/', 'local-storage' );
Load and start managing an account.
$api = FS::Api()->Load($profileid);
$api->Create('website')
->Attributes([
'name' => 'MyWebsite',
'domain' => 'example.website.ltd',
'proto' => 'https://'
])
->As('website');
Add the site id meta tag as follow
<meta name="fs:siteid" content="<?php echo $api->_website('siteid');?>">
$api->Get('website')
->Where([
'siteid' => $api->_website('siteid')
])
->verify();
A strategy is composed of modules and objectives.
$api->Create('strategy')
->Attributes([
'name' => 'Default strategy',
'siteid' => $api->_website('siteid')
])
->As('defaultStrategy');
Modules are bundles composed of a subject, body and form inputs. Each module can be customized to handle events and responses individually. Modules can be chain linked together to create contiuous interactions. API documentation
An objective allows you to define notification methods, and goals based on obtained information. API documentation