comments
Creates, updates, deletes, gets or lists a comments resource.
Overview
| Name | comments |
| Type | Resource |
| Id | github.gists.comments |
Fields
The following fields are returned by SELECT queries:
- get_comment
- list_comments
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
node_id | string | (example: MDExOkdpc3RDb21tZW50MQ==) |
author_association | string | How the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER) |
body | string | The comment text. (example: Body of the attachment) |
created_at | string (date-time) | (example: 2011-04-18T23:23:56Z) |
updated_at | string (date-time) | (example: 2011-04-18T23:23:56Z) |
url | string (uri) | (example: https://api.github.com/gists/a6db0bec360bb87e9418/comments/1) |
user | object | A GitHub user. (title: Simple User) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | |
node_id | string | (example: MDExOkdpc3RDb21tZW50MQ==) |
author_association | string | How the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER) |
body | string | The comment text. (example: Body of the attachment) |
created_at | string (date-time) | (example: 2011-04-18T23:23:56Z) |
updated_at | string (date-time) | (example: 2011-04-18T23:23:56Z) |
url | string (uri) | (example: https://api.github.com/gists/a6db0bec360bb87e9418/comments/1) |
user | object | A GitHub user. (title: Simple User) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_comment | select | gist_id, comment_id | Gets a comment on a gist. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type. | |
list_comments | select | gist_id | per_page, page | Lists the comments on a gist. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type. |
create_comment | insert | gist_id, body | Creates a comment on a gist. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type. | |
update_comment | update | gist_id, comment_id, body | Updates a comment on a gist. This endpoint supports the following custom media types. For more information, see "Media types." - application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type. | |
delete_comment | delete | gist_id, comment_id |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
comment_id | integer (int64) | The unique identifier of the comment. |
gist_id | string | The unique identifier of the gist. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_comment
- list_comments
Gets a comment on a gist.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type.
SELECT
id,
node_id,
author_association,
body,
created_at,
updated_at,
url,
user
FROM github.gists.comments
WHERE gist_id = '{{ gist_id }}' -- required
AND comment_id = '{{ comment_id }}' -- required
;
Lists the comments on a gist.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type.
SELECT
id,
node_id,
author_association,
body,
created_at,
updated_at,
url,
user
FROM github.gists.comments
WHERE gist_id = '{{ gist_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
INSERT examples
- create_comment
- Manifest
Creates a comment on a gist.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type.
INSERT INTO github.gists.comments (
body,
gist_id
)
SELECT
'{{ body }}' /* required */,
'{{ gist_id }}'
RETURNING
id,
node_id,
author_association,
body,
created_at,
updated_at,
url,
user
;
# Description fields are for documentation purposes
- name: comments
props:
- name: gist_id
value: "{{ gist_id }}"
description: Required parameter for the comments resource.
- name: body
value: "{{ body }}"
description: |
The comment text.
UPDATE examples
- update_comment
Updates a comment on a gist.
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown. This is the default if you do not pass any specific media type.
UPDATE github.gists.comments
SET
body = '{{ body }}'
WHERE
gist_id = '{{ gist_id }}' --required
AND comment_id = '{{ comment_id }}' --required
AND body = '{{ body }}' --required
RETURNING
id,
node_id,
author_association,
body,
created_at,
updated_at,
url,
user;
DELETE examples
- delete_comment
No description available.
DELETE FROM github.gists.comments
WHERE gist_id = '{{ gist_id }}' --required
AND comment_id = '{{ comment_id }}' --required
;