Data must be sent in JSON format as a HTTP POST. The following example shows how to use this option. NOTE that you
MUST append the 'remote=yes' query string to the guardian url?
<?php
$data = array(
'apiKey' => 'AO2CN4UJGW3PR08YIVKB',
'timezone' => '',
'license' => array(
'prodkey' => 'key34567',
'prodid' => 'id34567'
'expire_in' => '2',
'expire_on' => '',
'timeservers' => 'pool.ntp.org' (Optional, comma delimit multiple)
),
'restrictions' => array(
'encpref' => '--domain example.com'
),
'text' => array(
'block 1',
'block 2'
),
'constants' => array(
array(
'key' => 'keyone',
'value' => 'value one'
),
array(
'key' => 'keytwo',
'value' => 'value two'
)
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/guardian/index.php?remote=yes');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
$r = curl_exec($ch);
curl_close($ch);
echo $r;
?>