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 cube url?
<?php
$data = array(
'apiKey' => 'AO2CN4UJGW3PR08YIVKB',
'timezone' => '',
'license' => array(
'passphrase' => 'abc34567',
'expire_in' => '2',
'duration' => 'd',
'expire_on' => '',
'expose' => 'no'
),
'restrictions' => array(
'encoder_string' => '*.example.com,www.example.com,example.com@',
'expose' => 'no'
),
'headers' => array(
'block 1',
'block 2'
),
'properties' => array(
array(
'key' => 'keyone',
'value' => 'value one',
'expose' => 'no',
'enforce' => 'no'
),
array(
'key' => 'keytwo',
'value' => 'value two',
'expose' => 'yes',
'enforce' => 'yes'
)
)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.example.com/cube/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;
?>