Report push notification engagement event (interacted with optional topic)
curl --request POST \
--url https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'appid: <appid>' \
--data '
{
"topic": "dismissed"
}
'import requests
url = "https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement"
payload = { "topic": "dismissed" }
headers = {
"appid": "<appid>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {appid: '<appid>', apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({topic: 'dismissed'})
};
fetch('https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'topic' => 'dismissed'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>",
"appid: <appid>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement"
payload := strings.NewReader("{\n \"topic\": \"dismissed\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("appid", "<appid>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement")
.header("appid", "<appid>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"topic\": \"dismissed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["appid"] = '<appid>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"topic\": \"dismissed\"\n}"
response = http.request(request)
puts response.read_bodyPush Notifications
Report push notification engagement event (interacted with optional topic)
Report push notification engagement event.
POST
/
push-notifications
/
{id}
/
engagement
Report push notification engagement event (interacted with optional topic)
curl --request POST \
--url https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'appid: <appid>' \
--data '
{
"topic": "dismissed"
}
'import requests
url = "https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement"
payload = { "topic": "dismissed" }
headers = {
"appid": "<appid>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {appid: '<appid>', apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({topic: 'dismissed'})
};
fetch('https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'topic' => 'dismissed'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>",
"appid: <appid>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement"
payload := strings.NewReader("{\n \"topic\": \"dismissed\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("appid", "<appid>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement")
.header("appid", "<appid>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"topic\": \"dismissed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.api-{region}.cometchat.io/v3/campaigns/push-notifications/{id}/engagement")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["appid"] = '<appid>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"topic\": \"dismissed\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Your CometChat REST API Key.
Path Parameters
Body
application/json
Freeform topic discriminator for the interacted event. Custom values: any alphanumeric + underscore/hyphen string ≤64 chars.
Maximum string length:
64Example:
"dismissed"
Response
Engagement recorded
Was this page helpful?
⌘I