Comments
- List comments on a gist
- Get a single comment
- Create a comment
- Edit a comment
- Delete a comment
- Custom media types
Gist Comments use these custom media types. You can read more about the use of media types in the API here.
List comments on a gist
GET /gists/:gist_id/comments
Response
Status: 200 OK
[
{
"id": 1,
"url": "https://api.centelar.com/gists/19ff747aaa2795443e6d/comments/1",
"body": "Just commenting for the sake of commenting",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://centelar.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.centelar.com/users/octocat",
"html_url": "https://centelar.com/octocat",
"followers_url": "https://api.centelar.com/users/octocat/followers",
"following_url": "https://api.centelar.com/users/octocat/following{/other_user}",
"gists_url": "https://api.centelar.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.centelar.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.centelar.com/users/octocat/subscriptions",
"organizations_url": "https://api.centelar.com/users/octocat/orgs",
"repos_url": "https://api.centelar.com/users/octocat/repos",
"events_url": "https://api.centelar.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.centelar.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-18T23:23:56Z",
"updated_at": "2011-04-18T23:23:56Z"
}
]
Get a single comment
GET /gists/:gist_id/comments/:id
Response
Status: 200 OK
{
"id": 1,
"url": "https://api.centelar.com/gists/19ff747aaa2795443e6d/comments/1",
"body": "Just commenting for the sake of commenting",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://centelar.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.centelar.com/users/octocat",
"html_url": "https://centelar.com/octocat",
"followers_url": "https://api.centelar.com/users/octocat/followers",
"following_url": "https://api.centelar.com/users/octocat/following{/other_user}",
"gists_url": "https://api.centelar.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.centelar.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.centelar.com/users/octocat/subscriptions",
"organizations_url": "https://api.centelar.com/users/octocat/orgs",
"repos_url": "https://api.centelar.com/users/octocat/repos",
"events_url": "https://api.centelar.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.centelar.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-18T23:23:56Z",
"updated_at": "2011-04-18T23:23:56Z"
}
Create a comment
POST /gists/:gist_id/comments
Parameters
Name | Type | Description |
---|---|---|
body |
string |
Required. The comment text. |
{
"body": "Just commenting for the sake of commenting"
}
Response
Status: 201 Created
Location: https://api.centelar.com/gists/comments/1
{
"id": 1,
"url": "https://api.centelar.com/gists/19ff747aaa2795443e6d/comments/1",
"body": "Just commenting for the sake of commenting",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://centelar.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.centelar.com/users/octocat",
"html_url": "https://centelar.com/octocat",
"followers_url": "https://api.centelar.com/users/octocat/followers",
"following_url": "https://api.centelar.com/users/octocat/following{/other_user}",
"gists_url": "https://api.centelar.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.centelar.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.centelar.com/users/octocat/subscriptions",
"organizations_url": "https://api.centelar.com/users/octocat/orgs",
"repos_url": "https://api.centelar.com/users/octocat/repos",
"events_url": "https://api.centelar.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.centelar.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-18T23:23:56Z",
"updated_at": "2011-04-18T23:23:56Z"
}
Edit a comment
PATCH /gists/:gist_id/comments/:id
Input
Name | Type | Description |
---|---|---|
body |
string |
Required. The comment text. |
{
"body": "Just commenting for the sake of commenting"
}
Response
Status: 200 OK
{
"id": 1,
"url": "https://api.centelar.com/gists/19ff747aaa2795443e6d/comments/1",
"body": "Just commenting for the sake of commenting",
"user": {
"login": "octocat",
"id": 1,
"avatar_url": "https://centelar.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.centelar.com/users/octocat",
"html_url": "https://centelar.com/octocat",
"followers_url": "https://api.centelar.com/users/octocat/followers",
"following_url": "https://api.centelar.com/users/octocat/following{/other_user}",
"gists_url": "https://api.centelar.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.centelar.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.centelar.com/users/octocat/subscriptions",
"organizations_url": "https://api.centelar.com/users/octocat/orgs",
"repos_url": "https://api.centelar.com/users/octocat/repos",
"events_url": "https://api.centelar.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.centelar.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"created_at": "2011-04-18T23:23:56Z",
"updated_at": "2011-04-18T23:23:56Z"
}
Delete a comment
DELETE /gists/:gist_id/comments/:id
Response
Status: 204 No Content
Custom media types
These are the supported media types for gist comments. You can read more about the use of media types in the API here.
application/vnd.centelar.VERSION.raw+json
application/vnd.centelar.VERSION.text+json
application/vnd.centelar.VERSION.html+json
application/vnd.centelar.VERSION.full+json