Users
  • 4 Minutes to read
  • Dark
    Light

Users

  • Dark
    Light

Our users API can be used to add and manage users for AtomChat

List Users

POST


<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/listUsers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "offset=0&limit=100",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/listUsers \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data offset=0 \
  --data limit=100

Header Parameters
required
String
Your API Key

Form Parameters
required
Number
Page offset

required
Integer
The maximum number of results


Create User

POST


<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/createUser",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/createUser \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'

Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Unique User ID

optional
String
User's Name

optional
String
User's Avatar URL (Image)

optional
String
User's Profile URL

optional
String
User's Role (e.g. Administrator, Editor, Premium Member)

optional
String

Get User 

POST


<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/getUser",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "returnFriends=false&returnJoinedGroups=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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getUser \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data returnFriends=false \
  --data returnJoinedGroups=false
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Unique User ID

optional
Boolean
Get list of friends

optional
Boolean
Get list of groups user is part of


Get User Status

POST
Returns status and number of active conversations for a given set of users
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/getUserStatus",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getUserStatus \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
UIDs (Comma Separated)

Delete User

POST


<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/deleteUser",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/deleteUser \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Unique User ID

Update User

POST



<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/updateUser",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/updateUser \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Unique User ID

optional
String
User's Name

optional
String
User's Avatar URL (Image)

optional
String
User's Profile URL

optional
String
User's Role (e.g. Administrator, Editor, Premium Member)

Add Friends 

POST



<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/addFriends",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/addFriends \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Unique User ID

optional
String
Friends' UID (Comma Separated)

optional
Boolean
Set to 1 if you would like to erase existing friends

Delete Friends 

POST
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/deleteFriends",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/deleteFriends \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The Unique User ID

optional
String
Friends' UID (Comma Separated)

Block User 

POST


<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/blockUser",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/blockUser \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The UID initiating the block

optional
String
The UID of the user being blocked

Unblock User 

POST


<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.cometondemand.net/api/v2/unblockUser",
  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;
}
curl --request POST \
  --url https://api.cometondemand.net/api/v2/unblockUser \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Your API Key

Form Parameters
optional
String
The UID initiating the block

optional
String
The UID of the user getting unblocked

Was this article helpful?

What's Next