Adds/Remove collaborators
curl --request POST \
--url https://apimgmt.cometchat.io/apps/{appId}/collaborators \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"admins": [
"<string>"
],
"moderators": [
"<string>"
],
"collaboratorsToRemove": [
"<string>"
]
}
'import requests
url = "https://apimgmt.cometchat.io/apps/{appId}/collaborators"
payload = {
"admins": ["<string>"],
"moderators": ["<string>"],
"collaboratorsToRemove": ["<string>"]
}
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({
admins: ['<string>'],
moderators: ['<string>'],
collaboratorsToRemove: ['<string>']
})
};
fetch('https://apimgmt.cometchat.io/apps/{appId}/collaborators', 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}/collaborators",
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([
'admins' => [
'<string>'
],
'moderators' => [
'<string>'
],
'collaboratorsToRemove' => [
'<string>'
]
]),
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}/collaborators"
payload := strings.NewReader("{\n \"admins\": [\n \"<string>\"\n ],\n \"moderators\": [\n \"<string>\"\n ],\n \"collaboratorsToRemove\": [\n \"<string>\"\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}/collaborators")
.header("key", "<key>")
.header("secret", "<secret>")
.header("Content-Type", "application/json")
.body("{\n \"admins\": [\n \"<string>\"\n ],\n \"moderators\": [\n \"<string>\"\n ],\n \"collaboratorsToRemove\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apimgmt.cometchat.io/apps/{appId}/collaborators")
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 \"admins\": [\n \"<string>\"\n ],\n \"moderators\": [\n \"<string>\"\n ],\n \"collaboratorsToRemove\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"collaboratorsToRemove": [],
"admins": {
"admin1@cometchat.com": {
"success": true
},
"admin2@cometchat.com": {
"success": true
}
},
"developers": {
"developer1@cometchat.com": {
"success": true
}
},
"moderators": []
}
}Team Management
Adds/Remove collaborators
Adds or removes collaborators for an app.
POST
/
apps
/
{appId}
/
collaborators
Adds/Remove collaborators
curl --request POST \
--url https://apimgmt.cometchat.io/apps/{appId}/collaborators \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--data '
{
"admins": [
"<string>"
],
"moderators": [
"<string>"
],
"collaboratorsToRemove": [
"<string>"
]
}
'import requests
url = "https://apimgmt.cometchat.io/apps/{appId}/collaborators"
payload = {
"admins": ["<string>"],
"moderators": ["<string>"],
"collaboratorsToRemove": ["<string>"]
}
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({
admins: ['<string>'],
moderators: ['<string>'],
collaboratorsToRemove: ['<string>']
})
};
fetch('https://apimgmt.cometchat.io/apps/{appId}/collaborators', 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}/collaborators",
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([
'admins' => [
'<string>'
],
'moderators' => [
'<string>'
],
'collaboratorsToRemove' => [
'<string>'
]
]),
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}/collaborators"
payload := strings.NewReader("{\n \"admins\": [\n \"<string>\"\n ],\n \"moderators\": [\n \"<string>\"\n ],\n \"collaboratorsToRemove\": [\n \"<string>\"\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}/collaborators")
.header("key", "<key>")
.header("secret", "<secret>")
.header("Content-Type", "application/json")
.body("{\n \"admins\": [\n \"<string>\"\n ],\n \"moderators\": [\n \"<string>\"\n ],\n \"collaboratorsToRemove\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apimgmt.cometchat.io/apps/{appId}/collaborators")
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 \"admins\": [\n \"<string>\"\n ],\n \"moderators\": [\n \"<string>\"\n ],\n \"collaboratorsToRemove\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"collaboratorsToRemove": [],
"admins": {
"admin1@cometchat.com": {
"success": true
},
"admin2@cometchat.com": {
"success": true
}
},
"developers": {
"developer1@cometchat.com": {
"success": true
}
},
"moderators": []
}
}For the complete error reference, see Error Guide.
Path Parameters
AppID in which the extension has to be enabled/disabled
Body
application/json
Response
200 - application/json
Created App
Show child attributes
Show child attributes
Was this page helpful?
⌘I