Comments
Comments are a collaboration tool and can be left on items from the right-hand sidebar.
The comments Object
| Field Name | Type | Description |
|---|---|---|
id | uuid | Unique identifier for the comment object (UUID format). |
collection | string | Collection identifier in which the item resides. |
item | string | The item the comment is created for. |
comment | string | User comment. This will store the comments that show up in the right sidebar of the item edit page in the TrackVision UI. |
date_created | datetime | Timestamp in ISO8601 when the comment was created. |
date_updated | datetime | Timestamp in ISO8601 when the comment was last updated. |
user_created | object | The user who created the comment. Many-to-one relationship to users. |
user_updated | object | The user who last updated the comment. Many-to-one relationship to users. |
Get Comments
Returns a list of comments.
Request
- REST
- GraphQL
GET /comments
POST /graphql/system
type Query {
flows: [trackvision_comments]
}
Query Parameters
Supports all global query parameters.
Returns
An array of up to limit comment objects. If no items are available, data will be an empty array.
Get Comment by ID
Returns a single comment by primary key.
Request
- REST
- GraphQL
GET /comments/:id
POST /graphql/system
type Query {
comment_by_id(id: ID!): trackvision_comments
}
Query Parameters
Supports all global query parameters.
Response
Returns a comment object if a valid identifier was provided.
Create a Comment
Create a new comment. This action is only available to authenticated users.
Request
- REST
- GraphQL
POST /comments
Provide a comment object as the body of your request.
POST /graphql/system
type Mutation {
create_comments_item(data: create_trackvision_comments_input): trackvision_comments
}
Query Parameters
Supports all global query parameters.
Request Body
A partial comment object.
Response
Returns the comment object of the comment that was created.
Create Multiple Comments
Create multiple new comments. This action is only available to authenticated users.
Request
- REST
- GraphQL
POST /comments
Provide an array of comment objects as the body of your request.
POST /graphql/system
type Mutation {
create_comments_items(data: [create_trackvision_comments_input]): [trackvision_comments]
}
Query Parameters
Supports all global query parameters.
Request Body
An array of partial comment objects. name is required.
Response
Returns an array of comment objects of the comments that were created.
Update a Comment
Update an existing comment. This action is only available to authenticated users.
Request
- REST
- GraphQL
PATCH /comments/:id
Provide a partial comment object as the body of your request.
POST /graphql/system
type Mutation {
update_comments_item(id: ID!, data: update_trackvision_comments_input): trackvision_comments
}
Query Parameters
Supports all global query parameters.
Request Body
A partial comment object.
Response
Returns the comment object of the comment that was updated.
Update Multiple Comments
Update multiple existing comments. This action is only available to authenticated users.
Request
- REST
- GraphQL
PATCH /comments
{
"keys": comment_id_array,
"data": partial_comment_objects
}
POST /graphql/system
type Mutation {
update_comments_items(ids: [ID!]!, data: update_trackvision_comments_input): [trackvision_comments]
}
Query Parameters
Supports all global query parameters.
Request Body
keys Required
Array of primary keys of the comments you'd like to update.
data Required
Any of the comment object's properties.
Response
Returns the comment objects of the comments that were updated.
Delete a Comment
Delete an existing comment. This action is only available to authenticated users.
Request
- REST
- GraphQL
DELETE /comments/:id
POST /graphql/system
type Mutation {
delete_comments_item(id: ID!): delete_one
}
Response
Empty body.
Delete Multiple Comments
Delete multiple existing comments. This action is only available to authenticated users.
Request
- REST
- GraphQL
DELETE /comments
Provide an array of item IDs as your request body.
POST /graphql/system
type Mutation {
delete_comments_items(ids: [ID!]!): delete_many
}
Request Body
An array of comment primary keys.
Returns
Empty body.