Gists
View, modify your gists.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /gists | List gists for the authenticated user |
POST | /gists | Create a gist |
GET | /gists/public | List public gists |
GET | /gists/starred | List starred gists |
GET | /gists/{gist_id} | Get a gist |
PATCH | /gists/{gist_id} | Update a gist |
DELETE | /gists/{gist_id} | Delete a gist |
GET | /gists/{gist_id}/comments | List gist comments |
POST | /gists/{gist_id}/comments | Create a gist comment |
GET | /gists/{gist_id}/comments/{comment_id} | Get a gist comment |
PATCH | /gists/{gist_id}/comments/{comment_id} | Update a gist comment |
DELETE | /gists/{gist_id}/comments/{comment_id} | Delete a gist comment |
GET | /gists/{gist_id}/commits | List gist commits |
GET | /gists/{gist_id}/forks | List gist forks |
POST | /gists/{gist_id}/forks | Fork a gist |
GET | /gists/{gist_id}/star | Check if a gist is starred |
PUT | /gists/{gist_id}/star | Star a gist |
DELETE | /gists/{gist_id}/star | Unstar a gist |
GET | /gists/{gist_id}/{sha} | Get a gist revision |
GET | /users/{username}/gists | List gists for a user |
Example
List gists for the authenticated user, with the TypeScript SDK:
ts
import { GitHubV3REST } from "github";
const client = new GitHubV3REST({
baseUrl: "https://api.github.com",
});
const result = await client.gists.list();
console.log(result);Nine more languages
The same call exists in every SDK. See SDKs for the other nine.