I can display the values using GET but i don't know how to use PUT to submit a request that will change the value of my data. here is my code:
if($visit >= 10){
$wh = curl_init();
curl_setopt($wh, CURLOPT_URL, "https://core.voluum.com/campaigns/" . $id);
curl_setopt($wh, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($wh, CURLOPT_CUSTOMREQUEST, "GET");
$head = array();
$head[] = "Cwauth-Token: " . $tok;
curl_setopt($wh, CURLOPT_HTTPHEADER, $head);
$resulta = curl_exec($wh);
if (curl_errno($wh)) {
echo 'Error:' . curl_error($wh);
}
echo "Request:" . "<br>";
$campinfo = json_decode($resulta, true);
echo '<pre>' . print_r($campinfo, TRUE) . '</pre>';
foreach($campinfo['pathsGroups'] as $datacamp){
echo $datacamp['active'];
Here is a part of my data:
Array
(
[pathsGroups] => Array
(
[0] => Array
(
[condition] => Array
(
[country] => Array
(
[predicate] => MUST_BE
[countryCodes] => Array
(
[0] => IQ
)
)
[customVariableConditions] => Array
(
[0] => Array
(
[predicate] => MUST_NOT_BE
[index] => 0
[texts] => Array
(
[0] =>
[1] => Unknown
[2] => unknown
)
[text] =>
)
[1] => Array
(
[predicate] => MUST_NOT_BE
[index] => 1
[texts] => Array
(
[0] => Unknown
[1] =>
[2] => unknown
)
[text] => Unknown
)
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
[8] =>
[9] =>
)
)
[paths] => Array
(
[0] => Array
(
[weight] => 100
[active] => 1
[landers] => Array
(
[0] => Array
(
[lander] => Array
(
[id] =>
[namePostfix] =>
[name] => Global
)
[weight] => 100
)
)
[offers] => Array
(
[0] => Array
(
[offer] => Array
(
[id] =>
[name] =>
[namePostfix] =>
)
[weight] => 100
)
)
)
)
[active] => 1 // change this to false so that it will be turned off in in the website
)
)
)
i want to change the active so i could turn off pathgroups