Create a comment for an entity.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/comments"), Content = new StringContent("{ \"CommentText\": \"example\", \"Owner\": { \"ModuleKey\": \"example\", \"ResourceKind\": \"example\", \"ContextResourceId\": \"example\", \"ResourceObjectId\": \"example\" }, \"ParentCommentId\": \"example\", \"Relations\": [ { \"Target\": { \"ModuleKey\": \"example\", \"ResourceKind\": \"example\", \"ContextResourceId\": \"example\", \"ResourceObjectId\": \"example\" }, \"RelationKind\": 0, \"Source\": { \"ModuleKey\": \"example\", \"ResourceKind\": \"example\", \"ContextResourceId\": \"example\", \"ResourceObjectId\": \"example\" }, \"PolicyCode\": \"example\", \"CorrelationId\": \"example\" } ], \"Origin\": { \"Source\": { \"ModuleKey\": \"example\", \"ResourceKind\": \"example\", \"ContextResourceId\": \"example\", \"ResourceObjectId\": \"example\" }, \"PolicyCode\": \"example\", \"CorrelationId\": \"example\" } }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/comments';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"CommentText":"example","Owner":{"ModuleKey":"example","ResourceKind":"example","ContextResourceId":"example","ResourceObjectId":"example"},"ParentCommentId":"example","Relations":[{"Target":{"ModuleKey":"example","ResourceKind":"example","ContextResourceId":"example","ResourceObjectId":"example"},"RelationKind":0,"Source":{"ModuleKey":"example","ResourceKind":"example","ContextResourceId":"example","ResourceObjectId":"example"},"PolicyCode":"example","CorrelationId":"example"}],"Origin":{"Source":{"ModuleKey":"example","ResourceKind":"example","ContextResourceId":"example","ResourceObjectId":"example"},"PolicyCode":"example","CorrelationId":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspace/comments \ --header 'Content-Type: application/json' \ --data '{ "CommentText": "example", "Owner": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "ParentCommentId": "example", "Relations": [ { "Target": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "RelationKind": 0, "Source": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "PolicyCode": "example", "CorrelationId": "example" } ], "Origin": { "Source": { "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }, "PolicyCode": "example", "CorrelationId": "example" } }'Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.
Request Body
Section titled “Request Body”Request payload to create a comment.
object
Comment text.
object
Optional parent comment identifier.
Optional resource relations attached to the comment.
object
object
object
object
object
Request payload to create a comment.
object
Comment text.
object
Optional parent comment identifier.
Optional resource relations attached to the comment.
object
object
object
object
object
Request payload to create a comment.
object
Comment text.
object
Optional parent comment identifier.
Optional resource relations attached to the comment.
object
object
object
object
object
Responses
Section titled “Responses”OK
object
Comment details.
object
Comment identifier.
object
Comment text.
Detected language for search.
Optional parent comment identifier.
Resource relations attached to the comment.
object
object
object
object
object
Creator user identifier.
Creator display name.
Last modifier user identifier.
Last modifier display name.
Edit deadline timestamp.
Whether the comment has been edited.
Number of replies.
Creation timestamp.
Last modification timestamp.
Whether the comment is soft deleted.
Permissions for a comment evaluated for the current user.
object
Whether the comment can be viewed.
Whether the comment can be edited.
Whether the comment can be deleted.
Whether a reply can be created.
object
object
object
object
Example
{ "Data": { "Relations": [ { "RelationKind": 0 } ] }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Bad Request
object
Comment details.
object
Comment identifier.
object
Comment text.
Detected language for search.
Optional parent comment identifier.
Resource relations attached to the comment.
object
object
object
object
object
Creator user identifier.
Creator display name.
Last modifier user identifier.
Last modifier display name.
Edit deadline timestamp.
Whether the comment has been edited.
Number of replies.
Creation timestamp.
Last modification timestamp.
Whether the comment is soft deleted.
Permissions for a comment evaluated for the current user.
object
Whether the comment can be viewed.
Whether the comment can be edited.
Whether the comment can be deleted.
Whether a reply can be created.
object
object
object
object
Example
{ "Data": { "Relations": [ { "RelationKind": 0 } ] }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Comment details.
object
Comment identifier.
object
Comment text.
Detected language for search.
Optional parent comment identifier.
Resource relations attached to the comment.
object
object
object
object
object
Creator user identifier.
Creator display name.
Last modifier user identifier.
Last modifier display name.
Edit deadline timestamp.
Whether the comment has been edited.
Number of replies.
Creation timestamp.
Last modification timestamp.
Whether the comment is soft deleted.
Permissions for a comment evaluated for the current user.
object
Whether the comment can be viewed.
Whether the comment can be edited.
Whether the comment can be deleted.
Whether a reply can be created.
object
object
object
object
Example
{ "Data": { "Relations": [ { "RelationKind": 0 } ] }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}