CometChat Developer Documentation

Welcome Ninja!

You'll find comprehensive guides and documentation to help you start working with CometChat as quickly as possible. Let's jump right in!

Get Started    
 

Welcome to our API reference!

You can view code examples, and you can switch the programming language of the examples with the tabs on the top. We provide examples in Curl, Node, Ruby, JavaScript and Python.

Calling the Restful API via Javascript?

For your account's security, you should not expose your API Key to your end users (in the browser). We recommend making an asynchronous call using Javascript to your server which, in turn, can call our Restful API and then return the results to the browser.

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

Suggest Edits

List Users

 
posthttps://api.cometondemand.net/api/v2/listUsers
curl --request POST \
  --url https://api.cometondemand.net/api/v2/listUsers \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/listUsers',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/listUsers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/listUsers");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/listUsers"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

offset
int32
required

Page offset

limit
int32
required

The maximum number of results

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Create User

 
posthttps://api.cometondemand.net/api/v2/createUser
curl --request POST \
  --url https://api.cometondemand.net/api/v2/createUser \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/createUser',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/createUser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/createUser");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/createUser"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

The Unique User ID

name
string
required

User's Name

avatarURL
string

User's Avatar URL (Image)

profileURL
string

User's Profile URL

role
string

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

Headers

api-key
string
required

Your API Key

 
 
posthttps://api.cometondemand.net/api/v2/getUser
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getUser \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getUser',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getUser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getUser");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getUser"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required
returnFriends
boolean

Get list of friends

returnJoinedGroups
boolean

Get list of groups user is part of

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Get User Status

Returns status and number of active conversations for a given set of users

 
posthttps://api.cometondemand.net/api/v2/getUserStatus
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getUserStatus \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getUserStatus',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getUserStatus")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getUserStatus");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getUserStatus"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UIDs
string
required

UIDs (Comma Separated)

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Delete User

 
posthttps://api.cometondemand.net/api/v2/deleteUser
curl --request POST \
  --url https://api.cometondemand.net/api/v2/deleteUser \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/deleteUser',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/deleteUser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/deleteUser");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/deleteUser"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

The Unique User ID

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Update User

 
posthttps://api.cometondemand.net/api/v2/updateUser
curl --request POST \
  --url https://api.cometondemand.net/api/v2/updateUser \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/updateUser',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/updateUser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/updateUser");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/updateUser"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

The Unique User ID

name
string

User's Name

avatarURL
string

User's Avatar URL (Image)

profileURL
string

User's Profile URL

role
string

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

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Add Friends

 
posthttps://api.cometondemand.net/api/v2/addFriends
curl --request POST \
  --url https://api.cometondemand.net/api/v2/addFriends \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/addFriends',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/addFriends")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/addFriends");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/addFriends"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

The Unique User ID

friendsUID
string
required

Friends' UID (Comma Separated)

clearExisting
boolean

Set to 1 if you would like to erase existing friends

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Delete Friends

 
posthttps://api.cometondemand.net/api/v2/deleteFriends
curl --request POST \
  --url https://api.cometondemand.net/api/v2/deleteFriends \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/deleteFriends',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/deleteFriends")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/deleteFriends");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/deleteFriends"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

The Unique User ID

friendsUID
string
required

Friends' UID (Comma Separated)

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Block User

 
posthttps://api.cometondemand.net/api/v2/blockUser
curl --request POST \
  --url https://api.cometondemand.net/api/v2/blockUser \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/blockUser',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/blockUser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/blockUser");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/blockUser"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

senderUID
string
required

The UID initiating the block

receiverUID
string
required

The UID of the user being blocked

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Unblock User

 
posthttps://api.cometondemand.net/api/v2/unblockUser
curl --request POST \
  --url https://api.cometondemand.net/api/v2/unblockUser \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/unblockUser',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/unblockUser")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/unblockUser");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/unblockUser"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

senderUID
string
required

The UID initiating the block

receiverUID
string
required

The UID of the user being unblocked

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Messaging

 

Use this API to programmatically send messages between users and groups.

Suggest Edits

Send Message

 
posthttps://api.cometondemand.net/api/v2/sendMessage
curl --request POST \
  --url https://api.cometondemand.net/api/v2/sendMessage \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/sendMessage',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/sendMessage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/sendMessage");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/sendMessage"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

senderUID
string
required

The UID of the user sending the message

receiverUID
string
required

The UID or GUID of the user/group receiving the message

isGroup
int32

If you are sending the message to a group, set this to 1

message
string
required

The message being sent

visibility
int32

If isGroup is set to 0 (i.e. one-on-one message), then you can choose where you want to display the message: 0 -> Both sender and receiver, 1 -> Only receiver, 2 -> Only sender

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Get Messages

 
posthttps://api.cometondemand.net/api/v2/getMessages
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getMessages \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getMessages',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getMessages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getMessages");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getMessages"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UIDs
string

Comma separated UIDs (if you want logs for only particular users)

offset
int32

Page offset

limit
int32

Maximum number of results

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Get Group Messages

 
posthttps://api.cometondemand.net/api/v2/getGroupMessages
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getGroupMessages \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getGroupMessages',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getGroupMessages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getGroupMessages");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getGroupMessages"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUIDs
string

Comma separated GUIDs (if you want logs for only particular groups)

offset
int32

Page offset

limit
int32

Maximum number of results

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Unread Message Count

 
posthttps://api.cometondemand.net/api/v2/getUnreadMessageCounts
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getUnreadMessageCounts \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getUnreadMessageCounts',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getUnreadMessageCounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getUnreadMessageCounts");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getUnreadMessageCounts"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

UID of user whose unread messages count you require

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Create Group

 
posthttps://api.cometondemand.net/api/v2/createGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/createGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/createGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/createGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/createGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/createGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

name
string
required

The name of the group

type
int32
required

The type of group: 0 -> Public group, 1 -> Password protected group, 2 -> Invitation only group

password
string

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

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Delete Group

 
posthttps://api.cometondemand.net/api/v2/deleteGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/deleteGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/deleteGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/deleteGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/deleteGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/deleteGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Add Users To Group

 
posthttps://api.cometondemand.net/api/v2/addUsersToGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/addUsersToGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/addUsersToGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/addUsersToGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/addUsersToGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/addUsersToGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

UIDs
string
required

Users' UID (Comma Separated)

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Remove Users From Group

 
posthttps://api.cometondemand.net/api/v2/removeUsersFromGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/removeUsersFromGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/removeUsersFromGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/removeUsersFromGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/removeUsersFromGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/removeUsersFromGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

UIDs
string
required

Users' UID (Comma Separated)

Headers

api-key
string
required

Your API Key

 
Suggest Edits

List Groups

 
posthttps://api.cometondemand.net/api/v2/getGroupList
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getGroupList \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getGroupList',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getGroupList")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getGroupList");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getGroupList"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Headers

api-key
string
required
 
Suggest Edits

Ban Users From Group

 
posthttps://api.cometondemand.net/api/v2/banUsersFromGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/banUsersFromGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/banUsersFromGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/banUsersFromGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/banUsersFromGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/banUsersFromGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

UIDs
string
required

Users' UID (Comma Separated)

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Kick Users From Group

 
posthttps://api.cometondemand.net/api/v2/kickUsersFromGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/kickUsersFromGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/kickUsersFromGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/kickUsersFromGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/kickUsersFromGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/kickUsersFromGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

UIDs
string
required

Users' UID (Comma Separated)

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Unban Users From Group

 
posthttps://api.cometondemand.net/api/v2/unbanUsersFromGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/unbanUsersFromGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/unbanUsersFromGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/unbanUsersFromGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/unbanUsersFromGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/unbanUsersFromGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

UIDs
string
required

Users' UID (Comma Separated)

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Update Group

 
posthttps://api.cometondemand.net/api/v2/updateGroup
curl --request POST \
  --url https://api.cometondemand.net/api/v2/updateGroup \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/updateGroup',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/updateGroup")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/updateGroup");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/updateGroup"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

GUID
string
required

The Group Unique ID

name
string

The name of the group

password
string

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

Headers

api-key
string
required

Your API Key

 
 
Suggest Edits

Update Credits

 
posthttps://api.cometondemand.net/api/v2/updateCredits
curl --request POST \
  --url https://api.cometondemand.net/api/v2/updateCredits \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/updateCredits',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/updateCredits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/updateCredits");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/updateCredits"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

The Unique User ID

credits
int32
required

The number of credits

deleteExistingCredits
boolean

If set to true, it will remove existing credits before updating

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Get Credits

 
posthttps://api.cometondemand.net/api/v2/getCredits
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getCredits \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getCredits',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getCredits")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getCredits");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getCredits"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

The Unique User ID

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Miscellaneous

 
Suggest Edits

Get UID

Returns UID for a given CID (CometChat ID)

 
posthttps://api.cometondemand.net/api/v2/getUID
curl --request POST \
  --url https://api.cometondemand.net/api/v2/getUID \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/getUID',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/getUID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/getUID");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/getUID"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

CID
string
required

CometChat ID

Headers

api-key
string
required

Your API Key

 
Suggest Edits

Right To Forget

Removes all data related to a user (can be used for GDPR)

 
posthttps://api.cometondemand.net/api/v2/rightToForget
curl --request POST \
  --url https://api.cometondemand.net/api/v2/rightToForget \
  --header 'api-key: api-key'
var request = require("request");

var options = { method: 'POST',
  url: 'https://api.cometondemand.net/api/v2/rightToForget',
  headers: { 'api-key': 'api-key' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://api.cometondemand.net/api/v2/rightToForget")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = 'api-key'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.cometondemand.net/api/v2/rightToForget");
xhr.setRequestHeader("api-key", "api-key");

xhr.send(data);
import requests

url = "https://api.cometondemand.net/api/v2/rightToForget"

headers = {'api-key': 'api-key'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Form Data

UID
string
required

UID of user

Headers

api-key
string
required

Your API Key