Websites

Each website must be registered and verified with Form Synergy services in order to enable interactions.

Retrieve a Website

GET /v1/{access-token}/website
                            
use \FormSynergy\Init as FS;

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

$api->Get('website')
    ->Where([
        'siteid' => $siteid
    ])
    ->As('GetDomain');
 
 
                            
                            
{
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-169b185e8dc05ad610a6e3a50a6e3712",
    "domain": "demo......com",
    "verified": "yes",
    "lastscan": "2019-02-02 02:50:35",
    "indexpage": "\/",
    "pagecount": "38",
    "etagcount": "5",
    "activestrategy": "mod-d2bee61964ff44202fde3f2d315317b7",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Demo Site",
    "tags": [
        "onload:ask-a-question",
        "click:callback-request",
        "click:contact-us",
        "onload:custom-form->(order-page)",
        "click:contact-us->(some-page)"
    ]
}
                            

Finding Websites

GET /v1/{access-token}/websites
                            
use \FormSynergy\Init as FS;

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

$api->Find('websites')
    ->Where([
        'domain' => 'demo......com',
    ])
    ->As('FindDomains');
 

$api->Find('websites')
    ->Where([
        'domain' => 'demo......com',
    ])
    ->As('FindDomain', 0);
 
 
                            
                            
// All domains found
[{
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-169b185e8dc05ad610a6e3a50a6e3712",
    "domain": "demo......com",
    "verified": "yes",
    "lastscan": "2019-02-02 02:50:35",
    "indexpage": "\/",
    "pagecount": "38",
    "etagcount": "2",
    "activestrategy": "mod-d2bee61964ff44202fde3f2d315317b7",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Demo Site",
    "tags": [
        "onload:ask-a-question",
        "click:callback-request",
        "click:contact-us",
        "onload:custom-form->(order-page)",
        "click:contact-us->(some-page)"
    ]
}, {
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-dddsddss610a6e3a50a6e3712",
    "domain": "demo.2.....com",
    "verified": "yes",
    "lastscan": "2019-02-02 02:50:35",
    "indexpage": "\/",
    "pagecount": "38",
    "etagcount": "5",
    "activestrategy": "mod-d2bee61964ff44202fde3f2d315317b7",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Demo Site 2",
    "tags": [
        "onload:ask-a-question",
        "click:callback-request",
        "click:contact-us",
        "onload:custom-form->(order-page)",
        "click:contact-us->(some-page)"
    ]
}]

// The first domain found
{
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-169b185e8dc05ad610a6e3a50a6e3712",
    "domain": "demo......com",
    "verified": "yes",
    "lastscan": "2019-02-02 02:50:35",
    "indexpage": "\/",
    "pagecount": "38",
    "etagcount": "6",
    "activestrategy": "mod-d2bee61964ff44202fde3f2d315317b7",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Demo Site",
    "tags": [
        "onload:ask-a-question",
        "click:callback-request",
        "click:contact-us",
        "onload:custom-form->(order-page)",
        "click:contact-us->(some-page)",
        "mouseover:need-help->(some-page)"
    ]
}
                            

Register a Website

POST /v1/{access-token}/website
                            
use \FormSynergy\Init as FS;

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

$api->Create('website')
    ->Attributes([
        'proto' => 'https://',
        'domain' => 'example......com',
        'name' => 'Example Site',
        'indexpage' => '/'
    ])
    ->As('CreateWebsite');
 
 
                            
                            
{
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-169b185e8dc05ad610a6e3a50a6e3712",
    "domain": "demo......com",
    "verified": "no",
    "lastscan": "never",
    "indexpage": "\/",
    "pagecount": "0",
    "etagcount": "0",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Demo Site"
}
                            

Update Website

PUT /v1/{access-token}/website
                            
use \FormSynergy\Init as FS;

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

$api->Find('websites')
    ->Where([
        'domain' => 'example......com',
    ])
    ->As('GetDomain', 0);
 
$api->Get('website')
    ->Where([
        'siteid' => $api->_getDomain('siteid')
    ])
    ->Update([
        'name' => 'Interaction API Example',
        'indexpage' => '/'
    ])
    ->As('UpdateWebsite');
 
 
                            
                            

{
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-169b185e8dc05ad610a6e3a50a6e3712",
    "domain": "demo......com",
    "verified": "yes",
    "lastscan": "2019-02-02 02:50:35",
    "indexpage": "\/",
    "pagecount": "38",
    "etagcount": "5",
    "activestrategy": "mod-d2bee61964ff44202fde3f2d315317b7",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Interaction API Example",
    "tags": [
        "onload:ask-a-question",
        "click:callback-request",
        "click:contact-us",
        "onload:custom-form->(order-page)",
        "click:contact-us->(some-page)"
    ]
}
                            

Delete a Website

DELETE /v1/{access-token}/website
                            
use \FormSynergy\Init as FS;

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

$api->Get('website')
    ->Where([
        'siteid' => $siteid
    ])->Delete()
    ->As('DeleteMySite');

 
                            
                            
{
    "code": 200,
    "messages": ["Item removed"],
    "AccessPoint": "754a3683204940fd0f6ac39b25d127e3",
    "profileid": "profile-3be1fa342a520cbdf28aa43ab8edefee",
    "uri": "\/v1\/754a3683204940fd0f6ac39b25d127e3\/website"
}
                            

Verify a Website

PUT /v1/{access-token}/website
                            
use \FormSynergy\Init as FS;

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

$api->Find('websites')
    ->Where([
        'domain' => 'demo......com',
    ])
    ->As('getDomain', 0);
 
$api->Get('website')
    ->Where([
        'siteid' => $api->_getDomain('siteid')
    ])
    ->Verify()
    ->As('VerifyWebsite');
    
 
                            
                            
{
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-169b185e8dc05ad610a6e3a50a6e3712",
    "domain": "demo......com",
    "verified": "yes",
    "lastscan": "2019-02-02 02:50:35",
    "indexpage": "\/",
    "pagecount": "0",
    "etagcount": "0",
    "activestrategy": "mod-d2bee61964ff44202fde3f2d315317b7",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Demo Site"
}
                            

Scan a Website

PUT /v1/{access-token}/website
                            
use \FormSynergy\Init as FS;

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

$api->Find('websites')
    ->Where([
        'domain' => 'demo......com',
    ])
    ->As('getDomain', 0);
 
$api->Get('website')
    ->Where([
        'siteid' => $api->_getDomain('siteid')
    ])
    ->Scan()
    ->As('ScanWebsite');
    
 
                            
                            
{
    "profileid": "profile-c2300300a5075ee8adae51da57c39f90",
    "stamped": "2019-02-26 12:46:23",
    "siteid": "web-169b185e8dc05ad610a6e3a50a6e3712",
    "domain": "demo......com",
    "verified": "yes",
    "lastscan": "2019-02-02 02:50:35",
    "indexpage": "\/",
    "pagecount": "38",
    "etagcount": "5",
    "activestrategy": "mod-d2bee61964ff44202fde3f2d315317b7",
    "screenshot": "",
    "proto": "http:\/\/",
    "name": "Demo Site",
    "tags": [
        "onload:ask-a-question",
        "click:callback-request",
        "click:contact-us",
        "onload:custom-form->(order-page)",
        "click:contact-us->(some-page)"
    ]
}