I have been trying to get MailList API to work. Have created php script called addemail.php.
The script has the following:-
// require the setup which has registered the autoloader
require_once dirname(__FILE__) . '/setup.php';
// CREATE THE ENDPOINT
$endpoint = new MailWizzApi_Endpoint_ListSubscribers();
$list_unique_id = "xl114yr8tp732";
// ADD SUBSCRIBER
$response = $endpoint->create($list_unique_id, array(
'EMAIL' => 'john.doe@doe.com', // the confirmation email will be sent!!! Use valid email address
'FNAME' => 'John',
'LNAME' => 'Doe'
));
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
The setup.php has been configured with
// configuration object
$config = new MailWizzApi_Config(array(
'apiUrl' => 'http://www.mydomain.com/mailwizz/api',
'publicKey' => 'public_key',
'privateKey' => 'private_key',
// components
'components' => array(
'cache' => array(
'class' => 'MailWizzApi_Cache_File',
'filesPath' => dirname(__FILE__) . '/MailWizzApi/Cache/data/cache', // make sure it is writable by webserver
)
),
));
I have made the cache folder writable with chmod -R 777 cache command.
When I run the addemail.php, it seems to run it, but the web-page remain blank after the run.
I then expanded the addemail.php to try to read the existing users from an other list:-
// GET ALL ITEMS
$response = $endpoint->getSubscribers($list_unique_id, $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo "ALL USERS:</br>";
echo '<pre>';
print_r($response->body);
echo '</pre>';
echo "SCRIPT COMPLETE";
--> Again the script just produces a "white page", even text "SCRIPT COMPLETE" is not outputted to the page.
Any ideas what could be wrong / what should I check.
The script has the following:-
// require the setup which has registered the autoloader
require_once dirname(__FILE__) . '/setup.php';
// CREATE THE ENDPOINT
$endpoint = new MailWizzApi_Endpoint_ListSubscribers();
$list_unique_id = "xl114yr8tp732";
// ADD SUBSCRIBER
$response = $endpoint->create($list_unique_id, array(
'EMAIL' => 'john.doe@doe.com', // the confirmation email will be sent!!! Use valid email address
'FNAME' => 'John',
'LNAME' => 'Doe'
));
// DISPLAY RESPONSE
echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
The setup.php has been configured with
// configuration object
$config = new MailWizzApi_Config(array(
'apiUrl' => 'http://www.mydomain.com/mailwizz/api',
'publicKey' => 'public_key',
'privateKey' => 'private_key',
// components
'components' => array(
'cache' => array(
'class' => 'MailWizzApi_Cache_File',
'filesPath' => dirname(__FILE__) . '/MailWizzApi/Cache/data/cache', // make sure it is writable by webserver
)
),
));
I have made the cache folder writable with chmod -R 777 cache command.
When I run the addemail.php, it seems to run it, but the web-page remain blank after the run.
I then expanded the addemail.php to try to read the existing users from an other list:-
// GET ALL ITEMS
$response = $endpoint->getSubscribers($list_unique_id, $pageNumber = 1, $perPage = 10);
// DISPLAY RESPONSE
echo "ALL USERS:</br>";
echo '<pre>';
print_r($response->body);
echo '</pre>';
echo "SCRIPT COMPLETE";
--> Again the script just produces a "white page", even text "SCRIPT COMPLETE" is not outputted to the page.
Any ideas what could be wrong / what should I check.