Skip to main content

comments

Creates, updates, deletes, gets or lists a comments resource.

Overview

Namecomments
TypeResource
Idgithub.gists.comments

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
node_idstring (example: MDExOkdpc3RDb21tZW50MQ==)
author_associationstringHow the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER)
bodystringThe comment text. (example: Body of the attachment)
created_atstring (date-time) (example: 2011-04-18T23:23:56Z)
updated_atstring (date-time) (example: 2011-04-18T23:23:56Z)
urlstring (uri) (example: https://api.github.com/gists/a6db0bec360bb87e9418/comments/1)
userobjectA GitHub user. (title: Simple User)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_commentselectgist_id, comment_idGets 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_commentsselectgist_idper_page, pageLists 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_commentinsertgist_id, bodyCreates 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_commentupdategist_id, comment_id, bodyUpdates 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_commentdeletegist_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.

NameDatatypeDescription
comment_idinteger (int64)The unique identifier of the comment.
gist_idstringThe unique identifier of the gist.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

No description available.

DELETE FROM github.gists.comments
WHERE gist_id = '{{ gist_id }}' --required
AND comment_id = '{{ comment_id }}' --required
;