PHP code example of tantacula / getresponse

1. Go to this page and download the library: Download tantacula/getresponse 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/ */

    

tantacula / getresponse example snippets


$getresponse = new GetResponse('your_api_key');

$getresponse = new GetResponse('your_api_key');
$getresponse->enterprise_domain = 'somedomain.com';

//api URL is relative to your domain UR:
$getresponse->api_url = 'https://api3.getresponse360.pl/v3'; //for PL domains
$getresponse->api_url = 'https://api3.getresponse360.com/v3'; //default

$result = $getresponse->getContacts(array(
	'query' => array(
		'email' => '@getresponse.com',
	),
	'fields' => 'name,email'
));

$getresponse->addContact(array(
    'name'              => 'Jon Smith',
    'email'             => '[email protected]',
    'dayOfCycle'        => 0,
    'campaign'          => array('campaignId' => 'campaign_id_obtained_by_API'),
    'ipAddress'         => '89.206.31.190',
    'customFieldValues' => array(
        array('customFieldId' => 'custom_field_id_obtained_by_API',
            'value' => array(
                'Y'
            )),
         array('customFieldId' => 'custom_field_id_obtained_by_API',
            'value' => array(
                'Y'
            ))
    )
));

$result = $getresponse->sendNewsletter(array(
				"subject" => 'Test subject',
				"fromField" => array('fromFieldId' => 'from_field_id'),
				"content" => array(
					'html' => 'Test newsletter contetnt.'
				),
				"sendSettings" => array(
					"selectedContacts" => array('contact_id_obtained_by_API')
			)
    ));

$getresponse->setCustomField(array(
				'name' => 'custom_name',
				'type' => 'text',
				'hidden' => 'false',
    ));

$result = $getresponse->searchContacts();

$result = $getresponse->getForms();

$result = $getresponse->getWebForms();