Update Group Conversation
curl --request PUT \
--url https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'onBehalfOf: <onbehalfof>' \
--data '
{
"tags": [
"<string>"
]
}
'import requests
url = "https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation"
payload = { "tags": ["<string>"] }
headers = {
"onBehalfOf": "<onbehalfof>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
onBehalfOf: '<onbehalfof>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({tags: ['<string>']})
};
fetch('https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation', 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/groups/{guid}/conversation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>",
"onBehalfOf: <onbehalfof>"
],
]);
$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/groups/{guid}/conversation"
payload := strings.NewReader("{\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("onBehalfOf", "<onbehalfof>")
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.put("https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation")
.header("onBehalfOf", "<onbehalfof>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["onBehalfOf"] = '<onbehalfof>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"conversationId": "group_project-group",
"conversationType": "group",
"unreadMessageCount": "0",
"createdAt": 1630071782,
"updatedAt": 1630481413,
"lastMessage": {
"id": "50",
"conversationId": "group_project-group",
"sender": "cometchat-uid-4",
"receiverType": "group",
"receiver": "project-group",
"category": "action",
"type": "groupMember",
"data": {
"action": "unbanned",
"entities": {
"by": {
"entity": {
"uid": "cometchat-uid-4",
"name": "Susan Marie",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp",
"status": "offline",
"createdAt": 1629869270
},
"entityType": "user"
},
"on": {
"entity": {
"uid": "cometchat-uid-3",
"link": "https://www.cometchat.com",
"name": "Nancy Grace",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp",
"status": "offline",
"createdAt": 1629869270,
"updatedAt": 1629964825,
"conversationId": "cometchat-uid-3_user_cometchat-uid-4"
},
"entityType": "user"
},
"for": {
"entity": {
"guid": "project-group",
"icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp",
"name": "Project Group1",
"type": "private",
"owner": "cometchat-uid-4",
"createdAt": 1630071341,
"updatedAt": 1630305525,
"updatedBy": "cometchat-uid-4",
"description": "project related discussions between members",
"membersCount": 4,
"conversationId": "group_project-group"
},
"entityType": "group"
}
}
},
"sentAt": 1630305562,
"updatedAt": 1630305562,
"receipts": {
"data": [
[]
]
}
},
"conversationWith": {
"guid": "project-group",
"name": "Project Group1",
"description": "project related discussions between members",
"icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp",
"type": "private",
"scope": "participant",
"membersCount": 4,
"joinedAt": 1630071782,
"conversationId": "group_project-group",
"hasJoined": true,
"createdAt": 1630071341,
"owner": "cometchat-uid-4",
"updatedAt": 1630308875,
"updatedBy": "cometchat-uid-4"
}
}
]
}Conversations
Update Group Conversation
Update group details, members, and settings for an existing conversation using the REST API, with linked error codes.
PUT
/
groups
/
{guid}
/
conversation
Update Group Conversation
curl --request PUT \
--url https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'onBehalfOf: <onbehalfof>' \
--data '
{
"tags": [
"<string>"
]
}
'import requests
url = "https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation"
payload = { "tags": ["<string>"] }
headers = {
"onBehalfOf": "<onbehalfof>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
onBehalfOf: '<onbehalfof>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({tags: ['<string>']})
};
fetch('https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation', 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/groups/{guid}/conversation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>",
"onBehalfOf: <onbehalfof>"
],
]);
$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/groups/{guid}/conversation"
payload := strings.NewReader("{\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("onBehalfOf", "<onbehalfof>")
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.put("https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation")
.header("onBehalfOf", "<onbehalfof>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{appId}.api-{region}.cometchat.io/v3/groups/{guid}/conversation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["onBehalfOf"] = '<onbehalfof>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"conversationId": "group_project-group",
"conversationType": "group",
"unreadMessageCount": "0",
"createdAt": 1630071782,
"updatedAt": 1630481413,
"lastMessage": {
"id": "50",
"conversationId": "group_project-group",
"sender": "cometchat-uid-4",
"receiverType": "group",
"receiver": "project-group",
"category": "action",
"type": "groupMember",
"data": {
"action": "unbanned",
"entities": {
"by": {
"entity": {
"uid": "cometchat-uid-4",
"name": "Susan Marie",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp",
"status": "offline",
"createdAt": 1629869270
},
"entityType": "user"
},
"on": {
"entity": {
"uid": "cometchat-uid-3",
"link": "https://www.cometchat.com",
"name": "Nancy Grace",
"role": "default",
"avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp",
"status": "offline",
"createdAt": 1629869270,
"updatedAt": 1629964825,
"conversationId": "cometchat-uid-3_user_cometchat-uid-4"
},
"entityType": "user"
},
"for": {
"entity": {
"guid": "project-group",
"icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp",
"name": "Project Group1",
"type": "private",
"owner": "cometchat-uid-4",
"createdAt": 1630071341,
"updatedAt": 1630305525,
"updatedBy": "cometchat-uid-4",
"description": "project related discussions between members",
"membersCount": 4,
"conversationId": "group_project-group"
},
"entityType": "group"
}
}
},
"sentAt": 1630305562,
"updatedAt": 1630305562,
"receipts": {
"data": [
[]
]
}
},
"conversationWith": {
"guid": "project-group",
"name": "Project Group1",
"description": "project related discussions between members",
"icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp",
"type": "private",
"scope": "participant",
"membersCount": 4,
"joinedAt": 1630071782,
"conversationId": "group_project-group",
"hasJoined": true,
"createdAt": 1630071341,
"owner": "cometchat-uid-4",
"updatedAt": 1630308875,
"updatedBy": "cometchat-uid-4"
}
}
]
}For the complete error reference, see Error Guide.
Authorizations
Was this page helpful?