updateGroup

Description



Params

NameTypeDescription
apiKeystringAPI key previously generated.
idintegerId of the group that you want to update.
namestringName.
descriptionstringDescription.
positionintegerPosition of the group on listing.
enablebooleanTrue if group is enabled.
visiblebooleanTrue if group is visible.

 

Returned data

Type: boolean

Description: Return true if group was updated.

 

Json sample code

<?php

$curl = curl_init('https://your_address/ccm/admin/api/version/2/&type=json');

$postData = array(
    'function' => 'updateGroup',
    'apiKey' => 'apiKey',
    'id' => 5,
    'name' => 'My group',
    'description' => 'Group description',
    'position' => 1,
    'enable' => true,
    'visible' => true,
);

curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$json = curl_exec($curl);
if ($json === false) {
    die('Request failed with error: '. curl_error($curl));
}

$result = json_decode($json);
if ($result->status == 0) {
    die('Bad status returned. Error: '. $result->error);
}

var_dump($result->data);

 

Result of API call

bool(true)