Messaging
- 4 Minutes to read
-
DarkLight
Messaging
- 4 Minutes to read
-
DarkLight
You can use this API to programmatically send messages between users and groups.
Send Message
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/sendMessage",
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/sendMessage \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Form Parameters
optional
String
optional
String
optional
Integer
optional
String
optional
Integer
Get Messages
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/getMessages",
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/getMessages \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data offset=0 \
--data limit=100
Header Parameters
optional
String
Form Parameters
optional
String
optional
Integer
optional
Integer
optional
String
Get Group Messages
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/getGroupMessages",
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/getGroupMessages \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data offset=0 \
--data limit=100
Header Parameters
optional
String
Form Parameters
optional
String
optional
Integer
optional
String
Get Unread Message Count (One-on-one)
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/getUnreadMessageCounts",
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/getUnreadMessageCounts \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Form Parameters
optional
String
Get Unread Message Count for Groups
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/getUnreadMessageCountForGroups",
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/getUnreadMessageCountForGroups \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Form Parameters
optional
String
Get Call History
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/getCallHistory",
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/getCallHistory \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data offset=0 \
--data limit=100
Header Parameters
optional
String
Form Parameters
optional
Integer
optional
Integer
optional
String
optional
String
Send Sticker
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/sendSticker",
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/sendSticker \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Form Parameters
optional
String
optional
String
optional
Integer
optional
String
optional
String
Send File
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/sendFile",
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/sendFile \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Form Parameters
optional
String
optional
String
optional
Integer
optional
Object
Send Broadcast Message
POST
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometondemand.net/api/v2/sendBroadcastMessage",
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/sendBroadcastMessage \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded'
Header Parameters
optional
String
Form Parameters
optional
String
optional
String
optional
String
Was this article helpful?