Push notification Store settings
curl --request POST \
--url https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}
'import requests
url = "https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings"
payload = { "settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": True,
"android": True,
"ionic_cordova": True,
"react_native": False,
"ios": True,
"flutter": True
},
"useP8": True,
"sendApnsProduction": True,
"sendNewMessageNotification": True,
"sendEditMessageNotification": False,
"sendDeleteMessageNotification": False,
"sendThreadedMessageNotification": True,
"sendIncomingCallNotification": True,
"sendMissedCallNotification": True,
"sendMemberJoinedNotification": True,
"sendMemberLeftNotification": True,
"sendMemberKickedNotification": True,
"sendMemberBannedNotification": True,
"sendMemberUnbannedNotification": True,
"sendMemberAddedNotification": True,
"sendMemberScopeChangedNotification": False,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": False,
"skipReceiverMetadata": False,
"skipMessageMetadata": False,
"trimMessageText": True
}
} }
headers = {
"key": "<key>",
"secret": "<secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {key: '<key>', secret: '<secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({
settings: {
version: 2,
pushProvider: 1,
fcmCredentials: {
project_id: 'project_id',
client_email: 'client_email',
private_key: 'private_key',
private_key_id: 'private_key_id'
},
notificationInPayload: {
web: true,
android: true,
ionic_cordova: true,
react_native: false,
ios: true,
flutter: true
},
useP8: true,
sendApnsProduction: true,
sendNewMessageNotification: true,
sendEditMessageNotification: false,
sendDeleteMessageNotification: false,
sendThreadedMessageNotification: true,
sendIncomingCallNotification: true,
sendMissedCallNotification: true,
sendMemberJoinedNotification: true,
sendMemberLeftNotification: true,
sendMemberKickedNotification: true,
sendMemberBannedNotification: true,
sendMemberUnbannedNotification: true,
sendMemberAddedNotification: true,
sendMemberScopeChangedNotification: false,
keyId: 'key_id',
teamId: 'team_id',
bundleId: 'bundle_id',
appId: 'abcd',
cometchatMessagePayloadOptions: {
skipSenderMetadata: false,
skipReceiverMetadata: false,
skipMessageMetadata: false,
trimMessageText: true
}
}
})
};
fetch('https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings', 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://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings",
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([
'settings' => [
'version' => 2,
'pushProvider' => 1,
'fcmCredentials' => [
'project_id' => 'project_id',
'client_email' => 'client_email',
'private_key' => 'private_key',
'private_key_id' => 'private_key_id'
],
'notificationInPayload' => [
'web' => true,
'android' => true,
'ionic_cordova' => true,
'react_native' => false,
'ios' => true,
'flutter' => true
],
'useP8' => true,
'sendApnsProduction' => true,
'sendNewMessageNotification' => true,
'sendEditMessageNotification' => false,
'sendDeleteMessageNotification' => false,
'sendThreadedMessageNotification' => true,
'sendIncomingCallNotification' => true,
'sendMissedCallNotification' => true,
'sendMemberJoinedNotification' => true,
'sendMemberLeftNotification' => true,
'sendMemberKickedNotification' => true,
'sendMemberBannedNotification' => true,
'sendMemberUnbannedNotification' => true,
'sendMemberAddedNotification' => true,
'sendMemberScopeChangedNotification' => false,
'keyId' => 'key_id',
'teamId' => 'team_id',
'bundleId' => 'bundle_id',
'appId' => 'abcd',
'cometchatMessagePayloadOptions' => [
'skipSenderMetadata' => false,
'skipReceiverMetadata' => false,
'skipMessageMetadata' => false,
'trimMessageText' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"key: <key>",
"secret: <secret>"
],
]);
$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://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings"
payload := strings.NewReader("{\n \"settings\": {\n \"version\": 2,\n \"pushProvider\": 1,\n \"fcmCredentials\": {\n \"project_id\": \"project_id\",\n \"client_email\": \"client_email\",\n \"private_key\": \"private_key\",\n \"private_key_id\": \"private_key_id\"\n },\n \"notificationInPayload\": {\n \"web\": true,\n \"android\": true,\n \"ionic_cordova\": true,\n \"react_native\": false,\n \"ios\": true,\n \"flutter\": true\n },\n \"useP8\": true,\n \"sendApnsProduction\": true,\n \"sendNewMessageNotification\": true,\n \"sendEditMessageNotification\": false,\n \"sendDeleteMessageNotification\": false,\n \"sendThreadedMessageNotification\": true,\n \"sendIncomingCallNotification\": true,\n \"sendMissedCallNotification\": true,\n \"sendMemberJoinedNotification\": true,\n \"sendMemberLeftNotification\": true,\n \"sendMemberKickedNotification\": true,\n \"sendMemberBannedNotification\": true,\n \"sendMemberUnbannedNotification\": true,\n \"sendMemberAddedNotification\": true,\n \"sendMemberScopeChangedNotification\": false,\n \"keyId\": \"key_id\",\n \"teamId\": \"team_id\",\n \"bundleId\": \"bundle_id\",\n \"appId\": \"abcd\",\n \"cometchatMessagePayloadOptions\": {\n \"skipSenderMetadata\": false,\n \"skipReceiverMetadata\": false,\n \"skipMessageMetadata\": false,\n \"trimMessageText\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("key", "<key>")
req.Header.Add("secret", "<secret>")
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://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings")
.header("key", "<key>")
.header("secret", "<secret>")
.header("Content-Type", "application/json")
.body("{\n \"settings\": {\n \"version\": 2,\n \"pushProvider\": 1,\n \"fcmCredentials\": {\n \"project_id\": \"project_id\",\n \"client_email\": \"client_email\",\n \"private_key\": \"private_key\",\n \"private_key_id\": \"private_key_id\"\n },\n \"notificationInPayload\": {\n \"web\": true,\n \"android\": true,\n \"ionic_cordova\": true,\n \"react_native\": false,\n \"ios\": true,\n \"flutter\": true\n },\n \"useP8\": true,\n \"sendApnsProduction\": true,\n \"sendNewMessageNotification\": true,\n \"sendEditMessageNotification\": false,\n \"sendDeleteMessageNotification\": false,\n \"sendThreadedMessageNotification\": true,\n \"sendIncomingCallNotification\": true,\n \"sendMissedCallNotification\": true,\n \"sendMemberJoinedNotification\": true,\n \"sendMemberLeftNotification\": true,\n \"sendMemberKickedNotification\": true,\n \"sendMemberBannedNotification\": true,\n \"sendMemberUnbannedNotification\": true,\n \"sendMemberAddedNotification\": true,\n \"sendMemberScopeChangedNotification\": false,\n \"keyId\": \"key_id\",\n \"teamId\": \"team_id\",\n \"bundleId\": \"bundle_id\",\n \"appId\": \"abcd\",\n \"cometchatMessagePayloadOptions\": {\n \"skipSenderMetadata\": false,\n \"skipReceiverMetadata\": false,\n \"skipMessageMetadata\": false,\n \"trimMessageText\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["key"] = '<key>'
request["secret"] = '<secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settings\": {\n \"version\": 2,\n \"pushProvider\": 1,\n \"fcmCredentials\": {\n \"project_id\": \"project_id\",\n \"client_email\": \"client_email\",\n \"private_key\": \"private_key\",\n \"private_key_id\": \"private_key_id\"\n },\n \"notificationInPayload\": {\n \"web\": true,\n \"android\": true,\n \"ionic_cordova\": true,\n \"react_native\": false,\n \"ios\": true,\n \"flutter\": true\n },\n \"useP8\": true,\n \"sendApnsProduction\": true,\n \"sendNewMessageNotification\": true,\n \"sendEditMessageNotification\": false,\n \"sendDeleteMessageNotification\": false,\n \"sendThreadedMessageNotification\": true,\n \"sendIncomingCallNotification\": true,\n \"sendMissedCallNotification\": true,\n \"sendMemberJoinedNotification\": true,\n \"sendMemberLeftNotification\": true,\n \"sendMemberKickedNotification\": true,\n \"sendMemberBannedNotification\": true,\n \"sendMemberUnbannedNotification\": true,\n \"sendMemberAddedNotification\": true,\n \"sendMemberScopeChangedNotification\": false,\n \"keyId\": \"key_id\",\n \"teamId\": \"team_id\",\n \"bundleId\": \"bundle_id\",\n \"appId\": \"abcd\",\n \"cometchatMessagePayloadOptions\": {\n \"skipSenderMetadata\": false,\n \"skipReceiverMetadata\": false,\n \"skipMessageMetadata\": false,\n \"trimMessageText\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}Extensions
Push notification Store settings
Push notification : Store new settings for Push notifications extension
POST
/
apps
/
{appId}
/
extensions
/
push-notification
/
v1
/
settings
Push notification Store settings
curl --request POST \
--url https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}
'import requests
url = "https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings"
payload = { "settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": True,
"android": True,
"ionic_cordova": True,
"react_native": False,
"ios": True,
"flutter": True
},
"useP8": True,
"sendApnsProduction": True,
"sendNewMessageNotification": True,
"sendEditMessageNotification": False,
"sendDeleteMessageNotification": False,
"sendThreadedMessageNotification": True,
"sendIncomingCallNotification": True,
"sendMissedCallNotification": True,
"sendMemberJoinedNotification": True,
"sendMemberLeftNotification": True,
"sendMemberKickedNotification": True,
"sendMemberBannedNotification": True,
"sendMemberUnbannedNotification": True,
"sendMemberAddedNotification": True,
"sendMemberScopeChangedNotification": False,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": False,
"skipReceiverMetadata": False,
"skipMessageMetadata": False,
"trimMessageText": True
}
} }
headers = {
"key": "<key>",
"secret": "<secret>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {key: '<key>', secret: '<secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({
settings: {
version: 2,
pushProvider: 1,
fcmCredentials: {
project_id: 'project_id',
client_email: 'client_email',
private_key: 'private_key',
private_key_id: 'private_key_id'
},
notificationInPayload: {
web: true,
android: true,
ionic_cordova: true,
react_native: false,
ios: true,
flutter: true
},
useP8: true,
sendApnsProduction: true,
sendNewMessageNotification: true,
sendEditMessageNotification: false,
sendDeleteMessageNotification: false,
sendThreadedMessageNotification: true,
sendIncomingCallNotification: true,
sendMissedCallNotification: true,
sendMemberJoinedNotification: true,
sendMemberLeftNotification: true,
sendMemberKickedNotification: true,
sendMemberBannedNotification: true,
sendMemberUnbannedNotification: true,
sendMemberAddedNotification: true,
sendMemberScopeChangedNotification: false,
keyId: 'key_id',
teamId: 'team_id',
bundleId: 'bundle_id',
appId: 'abcd',
cometchatMessagePayloadOptions: {
skipSenderMetadata: false,
skipReceiverMetadata: false,
skipMessageMetadata: false,
trimMessageText: true
}
}
})
};
fetch('https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings', 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://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings",
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([
'settings' => [
'version' => 2,
'pushProvider' => 1,
'fcmCredentials' => [
'project_id' => 'project_id',
'client_email' => 'client_email',
'private_key' => 'private_key',
'private_key_id' => 'private_key_id'
],
'notificationInPayload' => [
'web' => true,
'android' => true,
'ionic_cordova' => true,
'react_native' => false,
'ios' => true,
'flutter' => true
],
'useP8' => true,
'sendApnsProduction' => true,
'sendNewMessageNotification' => true,
'sendEditMessageNotification' => false,
'sendDeleteMessageNotification' => false,
'sendThreadedMessageNotification' => true,
'sendIncomingCallNotification' => true,
'sendMissedCallNotification' => true,
'sendMemberJoinedNotification' => true,
'sendMemberLeftNotification' => true,
'sendMemberKickedNotification' => true,
'sendMemberBannedNotification' => true,
'sendMemberUnbannedNotification' => true,
'sendMemberAddedNotification' => true,
'sendMemberScopeChangedNotification' => false,
'keyId' => 'key_id',
'teamId' => 'team_id',
'bundleId' => 'bundle_id',
'appId' => 'abcd',
'cometchatMessagePayloadOptions' => [
'skipSenderMetadata' => false,
'skipReceiverMetadata' => false,
'skipMessageMetadata' => false,
'trimMessageText' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"key: <key>",
"secret: <secret>"
],
]);
$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://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings"
payload := strings.NewReader("{\n \"settings\": {\n \"version\": 2,\n \"pushProvider\": 1,\n \"fcmCredentials\": {\n \"project_id\": \"project_id\",\n \"client_email\": \"client_email\",\n \"private_key\": \"private_key\",\n \"private_key_id\": \"private_key_id\"\n },\n \"notificationInPayload\": {\n \"web\": true,\n \"android\": true,\n \"ionic_cordova\": true,\n \"react_native\": false,\n \"ios\": true,\n \"flutter\": true\n },\n \"useP8\": true,\n \"sendApnsProduction\": true,\n \"sendNewMessageNotification\": true,\n \"sendEditMessageNotification\": false,\n \"sendDeleteMessageNotification\": false,\n \"sendThreadedMessageNotification\": true,\n \"sendIncomingCallNotification\": true,\n \"sendMissedCallNotification\": true,\n \"sendMemberJoinedNotification\": true,\n \"sendMemberLeftNotification\": true,\n \"sendMemberKickedNotification\": true,\n \"sendMemberBannedNotification\": true,\n \"sendMemberUnbannedNotification\": true,\n \"sendMemberAddedNotification\": true,\n \"sendMemberScopeChangedNotification\": false,\n \"keyId\": \"key_id\",\n \"teamId\": \"team_id\",\n \"bundleId\": \"bundle_id\",\n \"appId\": \"abcd\",\n \"cometchatMessagePayloadOptions\": {\n \"skipSenderMetadata\": false,\n \"skipReceiverMetadata\": false,\n \"skipMessageMetadata\": false,\n \"trimMessageText\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("key", "<key>")
req.Header.Add("secret", "<secret>")
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://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings")
.header("key", "<key>")
.header("secret", "<secret>")
.header("Content-Type", "application/json")
.body("{\n \"settings\": {\n \"version\": 2,\n \"pushProvider\": 1,\n \"fcmCredentials\": {\n \"project_id\": \"project_id\",\n \"client_email\": \"client_email\",\n \"private_key\": \"private_key\",\n \"private_key_id\": \"private_key_id\"\n },\n \"notificationInPayload\": {\n \"web\": true,\n \"android\": true,\n \"ionic_cordova\": true,\n \"react_native\": false,\n \"ios\": true,\n \"flutter\": true\n },\n \"useP8\": true,\n \"sendApnsProduction\": true,\n \"sendNewMessageNotification\": true,\n \"sendEditMessageNotification\": false,\n \"sendDeleteMessageNotification\": false,\n \"sendThreadedMessageNotification\": true,\n \"sendIncomingCallNotification\": true,\n \"sendMissedCallNotification\": true,\n \"sendMemberJoinedNotification\": true,\n \"sendMemberLeftNotification\": true,\n \"sendMemberKickedNotification\": true,\n \"sendMemberBannedNotification\": true,\n \"sendMemberUnbannedNotification\": true,\n \"sendMemberAddedNotification\": true,\n \"sendMemberScopeChangedNotification\": false,\n \"keyId\": \"key_id\",\n \"teamId\": \"team_id\",\n \"bundleId\": \"bundle_id\",\n \"appId\": \"abcd\",\n \"cometchatMessagePayloadOptions\": {\n \"skipSenderMetadata\": false,\n \"skipReceiverMetadata\": false,\n \"skipMessageMetadata\": false,\n \"trimMessageText\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apimgmt.cometchat.io/apps/{appId}/extensions/push-notification/v1/settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["key"] = '<key>'
request["secret"] = '<secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settings\": {\n \"version\": 2,\n \"pushProvider\": 1,\n \"fcmCredentials\": {\n \"project_id\": \"project_id\",\n \"client_email\": \"client_email\",\n \"private_key\": \"private_key\",\n \"private_key_id\": \"private_key_id\"\n },\n \"notificationInPayload\": {\n \"web\": true,\n \"android\": true,\n \"ionic_cordova\": true,\n \"react_native\": false,\n \"ios\": true,\n \"flutter\": true\n },\n \"useP8\": true,\n \"sendApnsProduction\": true,\n \"sendNewMessageNotification\": true,\n \"sendEditMessageNotification\": false,\n \"sendDeleteMessageNotification\": false,\n \"sendThreadedMessageNotification\": true,\n \"sendIncomingCallNotification\": true,\n \"sendMissedCallNotification\": true,\n \"sendMemberJoinedNotification\": true,\n \"sendMemberLeftNotification\": true,\n \"sendMemberKickedNotification\": true,\n \"sendMemberBannedNotification\": true,\n \"sendMemberUnbannedNotification\": true,\n \"sendMemberAddedNotification\": true,\n \"sendMemberScopeChangedNotification\": false,\n \"keyId\": \"key_id\",\n \"teamId\": \"team_id\",\n \"bundleId\": \"bundle_id\",\n \"appId\": \"abcd\",\n \"cometchatMessagePayloadOptions\": {\n \"skipSenderMetadata\": false,\n \"skipReceiverMetadata\": false,\n \"skipMessageMetadata\": false,\n \"trimMessageText\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"settings": {
"version": 2,
"pushProvider": 1,
"fcmCredentials": {
"project_id": "project_id",
"client_email": "client_email",
"private_key": "private_key",
"private_key_id": "private_key_id"
},
"notificationInPayload": {
"web": true,
"android": true,
"ionic_cordova": true,
"react_native": false,
"ios": true,
"flutter": true
},
"useP8": true,
"sendApnsProduction": true,
"sendNewMessageNotification": true,
"sendEditMessageNotification": false,
"sendDeleteMessageNotification": false,
"sendThreadedMessageNotification": true,
"sendIncomingCallNotification": true,
"sendMissedCallNotification": true,
"sendMemberJoinedNotification": true,
"sendMemberLeftNotification": true,
"sendMemberKickedNotification": true,
"sendMemberBannedNotification": true,
"sendMemberUnbannedNotification": true,
"sendMemberAddedNotification": true,
"sendMemberScopeChangedNotification": false,
"keyId": "key_id",
"teamId": "team_id",
"bundleId": "bundle_id",
"appId": "abcd",
"cometchatMessagePayloadOptions": {
"skipSenderMetadata": false,
"skipReceiverMetadata": false,
"skipMessageMetadata": false,
"trimMessageText": true
}
}
}For the complete error reference, see Error Guide.
Path Parameters
AppID in which the extension has to be enabled/disabled
Body
application/json
Show child attributes
Show child attributes
Response
200 - application/json
Save Push Notification Settings
Show child attributes
Show child attributes
Was this page helpful?
⌘I