Skip to content
API client written in PHP to manage Form Synergy services
PHP
Branch: dev-master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
LICENSE
README.md
composer.json

README.md

FormSynergy.com API PHP library

A PHP library to manage Form Synergy services.

Install using composer

composer require form-synergy/php-api

Include the library

require '/vendor/autoload.php';

Enable session management

\FormSynergy\Session::enable();

Import the Form Synergy class

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 = '';

Configuration

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

local storage

Enable local storage to store downloads and responses.

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

Load account

Load and start managing an account.

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

Add a domain

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

Meta tag

Add the site id meta tag as follow

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

Verify

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

Create a strategy

A strategy is composed of modules and objectives.

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

Creating modules

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

Create an objective

An objective allows you to define notification methods, and goals based on obtained information. API documentation

You can’t perform that action at this time.