Groups
  • 4 Minutes to read
  • Dark
    Light

Groups

  • Dark
    Light

You can use our Groups API to create groups programmatically and manage group users!

Let's dive-in!

Create Group

POST


curl --request POST \
  --url https://api.cometondemand.net/api/v2/createGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/createGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID

optional
String
The name of the group

optional
Integer
The type of group: 0 -> Public group, 1 -> Password protected group, 4 -> Private group

optional
String
The password required to join the group (only if type is 1)

optional
String
You have to pass the UID of a user for this field. createdby is for the owner of the group and if it is not passed, then the group is considered system created. If it is passed, then the user whose UID is added will be considered the group owner for that particular group. 

Delete Group

POST
curl --request POST \
  --url https://api.cometondemand.net/api/v2/deleteGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/deleteGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID


Add Users to Group

POST
curl --request POST \
  --url https://api.cometondemand.net/api/v2/addUsersToGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data clearExisting=false
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/addUsersToGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "clearExisting=false",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID

optional
String
Users' UID (Comma Separated)

optional
Boolean

Remove Users From Group

POST
curl --request POST \
  --url https://api.cometondemand.net/api/v2/removeUsersFromGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/removeUsersFromGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID

optional
String
Users' UID (Comma Separated)

List Groups

POST
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getGroupList \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/getGroupList",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
Comma separated GUIDs (optional)

List Group Members

POST
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getGroupUserList \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/getGroupUserList",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
Comma separated GUIDs

Ban Users From Group

POST
curl --request POST \
  --url https://api.cometondemand.net/api/v2/banUsersFromGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/banUsersFromGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID

optional
String
Users' UID (Comma Separated)

Kick Users From Group

GET


curl --request POST \
  --url https://api.cometondemand.net/api/v2/kickUsersFromGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/kickUsersFromGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID

optional
String
Users' UID (Comma Separated)

Unban Users From Group

GET


curl --request POST \
  --url https://api.cometondemand.net/api/v2/unbanUsersFromGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/unbanUsersFromGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID

optional
String
Users' UID (Comma Separated)

Update Group

GET
curl --request POST \
  --url https://api.cometondemand.net/api/v2/updateGroup \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/updateGroup",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/x-www-form-urlencoded"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Group Unique ID

optional
String

What's Next