Add comment to task
curl --request POST \
--url https://app.thareja.ai/api/v3/task/comment/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"comment": "This task is progressing well. I've completed the first phase.",
"task_id": 456,
"refrence_id": 456,
"type": "update",
"watchersIds": [
5,
7,
9
]
}
EOFimport requests
url = "https://app.thareja.ai/api/v3/task/comment/add"
payload = {
"comment": "This task is progressing well. I've completed the first phase.",
"task_id": 456,
"refrence_id": 456,
"type": "update",
"watchersIds": [5, 7, 9]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
comment: 'This task is progressing well. I\'ve completed the first phase.',
task_id: 456,
refrence_id: 456,
type: 'update',
watchersIds: [5, 7, 9]
})
};
fetch('https://app.thareja.ai/api/v3/task/comment/add', 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://app.thareja.ai/api/v3/task/comment/add",
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([
'comment' => 'This task is progressing well. I\'ve completed the first phase.',
'task_id' => 456,
'refrence_id' => 456,
'type' => 'update',
'watchersIds' => [
5,
7,
9
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.thareja.ai/api/v3/task/comment/add"
payload := strings.NewReader("{\n \"comment\": \"This task is progressing well. I've completed the first phase.\",\n \"task_id\": 456,\n \"refrence_id\": 456,\n \"type\": \"update\",\n \"watchersIds\": [\n 5,\n 7,\n 9\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.thareja.ai/api/v3/task/comment/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"This task is progressing well. I've completed the first phase.\",\n \"task_id\": 456,\n \"refrence_id\": 456,\n \"type\": \"update\",\n \"watchersIds\": [\n 5,\n 7,\n 9\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.thareja.ai/api/v3/task/comment/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"This task is progressing well. I've completed the first phase.\",\n \"task_id\": 456,\n \"refrence_id\": 456,\n \"type\": \"update\",\n \"watchersIds\": [\n 5,\n 7,\n 9\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": 400,
"message": "Invalid request parameters"
}{
"error": 400,
"message": "Invalid request parameters"
}{
"error": "comment can't be null!"
}{
"error": 400,
"message": "Invalid request parameters"
}Task Comments
Add Comment to Task
Add a comment to a task and notify relevant team members
POST
/
api
/
v3
/
task
/
comment
/
add
Add comment to task
curl --request POST \
--url https://app.thareja.ai/api/v3/task/comment/add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"comment": "This task is progressing well. I've completed the first phase.",
"task_id": 456,
"refrence_id": 456,
"type": "update",
"watchersIds": [
5,
7,
9
]
}
EOFimport requests
url = "https://app.thareja.ai/api/v3/task/comment/add"
payload = {
"comment": "This task is progressing well. I've completed the first phase.",
"task_id": 456,
"refrence_id": 456,
"type": "update",
"watchersIds": [5, 7, 9]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
comment: 'This task is progressing well. I\'ve completed the first phase.',
task_id: 456,
refrence_id: 456,
type: 'update',
watchersIds: [5, 7, 9]
})
};
fetch('https://app.thareja.ai/api/v3/task/comment/add', 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://app.thareja.ai/api/v3/task/comment/add",
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([
'comment' => 'This task is progressing well. I\'ve completed the first phase.',
'task_id' => 456,
'refrence_id' => 456,
'type' => 'update',
'watchersIds' => [
5,
7,
9
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.thareja.ai/api/v3/task/comment/add"
payload := strings.NewReader("{\n \"comment\": \"This task is progressing well. I've completed the first phase.\",\n \"task_id\": 456,\n \"refrence_id\": 456,\n \"type\": \"update\",\n \"watchersIds\": [\n 5,\n 7,\n 9\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.thareja.ai/api/v3/task/comment/add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"This task is progressing well. I've completed the first phase.\",\n \"task_id\": 456,\n \"refrence_id\": 456,\n \"type\": \"update\",\n \"watchersIds\": [\n 5,\n 7,\n 9\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.thareja.ai/api/v3/task/comment/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"This task is progressing well. I've completed the first phase.\",\n \"task_id\": 456,\n \"refrence_id\": 456,\n \"type\": \"update\",\n \"watchersIds\": [\n 5,\n 7,\n 9\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": 400,
"message": "Invalid request parameters"
}{
"error": 400,
"message": "Invalid request parameters"
}{
"error": "comment can't be null!"
}{
"error": 400,
"message": "Invalid request parameters"
}Overview
Add a comment to a task. Comments can be used to discuss task details, provide updates, or ask questions. When a comment is added, relevant team members (watchers, assignee, reporter, and project managers) are automatically notified via email and push notifications.Request Body
string
required
The comment text. Supports HTML formatting.Example:
"This task is progressing well. I've completed the first phase."integer
required
The ID of the task to add the comment to. Can also be provided as
refrence_id.Example: 456array
Array of user IDs to add as watchers to the task when commenting. These users will receive notifications about future updates.Example:
[5, 7, 9]Example Request
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The comment text (supports HTML)
Example:
"This task is progressing well. I've completed the first phase."
The ID of the task to add the comment to
Example:
456
Alternative field for task_id
Example:
456
The type of comment
Example:
"update"
Array of user IDs to add as watchers
Example:
[5, 7, 9]
Response
Comment added successfully