Add Task Comment - MindBridge Documentation
Add Task Comment
Description
To add a comment to a task, use the following cURL command:
curl --request POST \
--url https://{tenant}.mindbridge.ai/api/v1/tasks/{taskId}/add-comment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"commentText": "<string>"
}
'
Example Code Snippets
Python
import requests
url = "https://{tenant}.mindbridge.ai/api/v1/tasks/{taskId}/add-comment"
payload = { "commentText": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
JavaScript (Fetch API)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({commentText: '<string>'})
};
fetch('https://{tenant}.mindbridge.ai/api/v1/tasks/{taskId}/add-comment', 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://{tenant}.mindbridge.ai/api/v1/tasks/{taskId}/add-comment",
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([
'commentText' => '<string>'
]),
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;
}
Sample Response
The response upon a successful comment addition will look like this:
{
"id": "<string>",
"version": 123,
"creationDate": "2023-11-07T05:31:56Z",
"lastModifiedDate": "2023-11-07T05:31:56Z",
"createdUserInfo": {
"userId": "<string>",
"userName": "<string>"
},
"lastModifiedUserInfo": {
"userId": "<string>",
"userName": "<string>"
},
"engagementId": "<string>",
"analysisResultId": "<string>",
"analysisId": "<string>",
"analysisTypeId": "<string>",
"transaction": "<string>",
"name": "<string>",
"rowId": 123,
"transactionId": 123,
"assignedId": "<string>",
"description": "<string>",
"comments": [
{
"commentText": "<string>",
"captured": "2023-11-07T05:31:56Z",
"authorId": "<string>"
}
],
"sample": "<string>",
"auditAreas": [
"<string>"
],
"assertions": [
"<string>"
],
"entryType": "<string>",
"vendorName": "<string>",
"customerName": "<string>",
"invoiceRef": "<string>",
"creditValue": 123,
"debitValue": 123,
"riskScores": {},
"filterStatement": "<string>",
"dueDate": "2023-12-25",
"approverId": "<string>",
"tags": [
"<string>"
],
"amounts": {}
}
Authorization
To authenticate requests, include the Authorization header with your Bearer token. The token format should be:
Authorization: Bearer <token>
Path Parameters
- taskId: (string) The ID of the task (required).
Body Parameters
- commentText: (string) The text of the comment (required).
Response Status Codes
- 200: OK