updateCaseComment¶
MUTATIONupdateCaseComment
Cases GraphQL API · Mutations
updateCaseComment updates an existing comment on a case. This is a PATCH style mutation, only fields that are send in the input will be updated. Only the user who created the comment can update it. Updating a comment and adding new @mentions will trigger new notifications but will not send notifications to @mentions that are already present in the comment.
Request samples¶
curl -X POST "https://api.taegis.sophos.com/graphql" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
\"query\": \"mutation UpdateCaseComment(\$input: UpdateCaseCommentInput!) { updateCaseComment(input: \$input) { id authorId authorSubject { id } createdAt updatedAt comment caseId tenantId mentionsIds mentionsSubjects { id } readByIds readBySubjects { id } } }\",
\"variables\": {
\"input\": {
\"commentId\": \"<commentId>\"
}
}
}"
import requests
response = requests.post(
"https://api.taegis.sophos.com/graphql",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
json={ 'query': 'mutation UpdateCaseComment($input: UpdateCaseCommentInput!) { '
'updateCaseComment(input: $input) { id authorId authorSubject { '
'id } createdAt updatedAt comment caseId tenantId mentionsIds '
'mentionsSubjects { id } readByIds readBySubjects { id } } }',
'variables': {'input': {'commentId': '<commentId>'}}},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
"Content-Type" = "application/json"
}
$body = '{
"query": "mutation UpdateCaseComment($input: UpdateCaseCommentInput!) { updateCaseComment(input: $input) { id authorId authorSubject { id } createdAt updatedAt comment caseId tenantId mentionsIds mentionsSubjects { id } readByIds readBySubjects { id } } }",
"variables": {
"input": {
"commentId": "<commentId>"
}
}
}'
Invoke-RestMethod -Method POST -Uri "https://api.taegis.sophos.com/graphql" -Headers $headers -Body $body -ContentType "application/json"
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, err := http.NewRequest("POST", "https://api.taegis.sophos.com/graphql", strings.NewReader(`{
"query": "mutation UpdateCaseComment($input: UpdateCaseCommentInput!) { updateCaseComment(input: $input) { id authorId authorSubject { id } createdAt updatedAt comment caseId tenantId mentionsIds mentionsSubjects { id } readByIds readBySubjects { id } } }",
"variables": {
"input": {
"commentId": "<commentId>"
}
}
}`))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api.taegis.sophos.com/graphql", {
method: "POST",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"query": "mutation UpdateCaseComment($input: UpdateCaseCommentInput!) { updateCaseComment(input: $input) { id authorId authorSubject { id } createdAt updatedAt comment caseId tenantId mentionsIds mentionsSubjects { id } readByIds readBySubjects { id } } }",
"variables": {
"input": {
"commentId": "<commentId>"
}
}
}),
});
const data = await response.json();
console.log(data);