This repository has been archived by the owner on Aug 21, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
2,590 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,346 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
<title>GitHub API Documentation - Mime Type</title> | ||
<link rel="icon" type="image/png" href="./favicon.ico" /> | ||
<link rel="stylesheet" href="./stylesheets/main.css" type="text/css" /> | ||
</head> | ||
<body> | ||
|
||
<header> | ||
<div class="wrapper"> | ||
<a href="/" class="logo"><img src="./images/main/octocat-brand.png" width="32" height="32" /></a> | ||
|
||
<nav role="alternate"> | ||
<ul> | ||
<li>logged in as <a href="https://github.com/paul">paul</a></li> | ||
<li><a href="/logout">logout</a></li> | ||
</ul> | ||
</nav> | ||
|
||
<form action="/search" method="get" class="search"> | ||
<input type="text" name="q" placeholder="Search API Documentation" value="" /> | ||
</form> | ||
</div> | ||
</header> | ||
|
||
<div id="wrapper"> | ||
|
||
<nav role="main"> | ||
<h1>Table of Contents</h1> | ||
<ul class='categories'> | ||
<li class='category'> | ||
<a href="#general">General</a> | ||
</li> | ||
<ul class='pages'> | ||
<li class='page'> | ||
<a href="#mime-type">Mime Type</a> | ||
</li> | ||
<li class='page'> | ||
<a href="#quick-reference">Quick Reference</a> | ||
</li> | ||
</ul> | ||
<li class='category'> | ||
<a href="#user">User</a> | ||
</li> | ||
<ul class='pages'> | ||
<li class='page'> | ||
<a href="#user-representation">Representation</a> | ||
</li> | ||
<li class='page'> | ||
<a href="#retrieve-current-user">Retrieve current user</a> | ||
</li> | ||
<li class='page'> | ||
<a href="#update-current-user">Update current user</a> | ||
</li> | ||
<li class='page'> | ||
<a href="#fetch-user-by-login">Fetch user by login</a> | ||
</li> | ||
</ul> | ||
</ul> | ||
|
||
</nav> | ||
|
||
<h1>GitHub API</h1> | ||
|
||
<p>This describes the resources that make up the official GitHub API v3. If<br> | ||
you have any problems or requests please contact<br> | ||
<a href="mailto:support@github.com?subject=APIv3">support</a>.</p> | ||
|
||
<p>View the <a href="/v3/changelog">API Changelog</a> for information on existing and<br> | ||
planned changes to the API.</p> | ||
<h1>Content Type</h1> | ||
|
||
<p>The GitHub API uses a vendor-specific mime type for web service requests and responses.</p> | ||
|
||
<pre><code>application/vnd.github.v3+json | ||
</code></pre> | ||
|
||
<p>We also accept the common <code>application/json</code> as an alias, but strongly discourage its use. It will always be mapped to the latest version of the API. If we upgrade the API at some point in the future, and you are relying on the previous version, bad things will probably happen.</p> | ||
<h1>Quick Reference</h1> | ||
<h2> | ||
<a href="#user">User</a> | ||
</h2> | ||
<table class='quickref'> | ||
<thead> | ||
<tr> | ||
<th>Usage</th> | ||
<th>Supported Methods</th> | ||
<th>URL</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td class='usage'> | ||
<a href="#retrieve-current-user">Retrieve current user</a> | ||
</td> | ||
<td class='method'> | ||
GET | ||
</td> | ||
<td class='url'> | ||
/user | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class='usage'> | ||
<a href="#update-current-user">Update current user</a> | ||
</td> | ||
<td class='method'> | ||
|
||
</td> | ||
<td class='url'> | ||
/user | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class='usage'> | ||
<a href="#fetch-user-by-login">Fetch user by login</a> | ||
</td> | ||
<td class='method'> | ||
GET | ||
</td> | ||
<td class='url'> | ||
/users/{login} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<h1>User</h1> | ||
|
||
<p>A <strong>User</strong> represents a person or automated actor on GitHub. They may own and<br> | ||
contribute to <a href="#repository">repositories</a> and belong to zero or more<br> | ||
<a href="#organization">organizations</a>. Users have email addresses and ssh keys, as well<br> | ||
as other relevant profile data.</p> | ||
<h2 id='user-representation'>Representation</h2> | ||
<h3>Attributes</h3> | ||
<dl class='attributes'> | ||
<dt>login</dt> | ||
<dd class='tags'> | ||
<ul> | ||
<li>string</li> | ||
</ul> | ||
</dd> | ||
<dd>The login name for the user</dd> | ||
<dt>name</dt> | ||
<dd class='tags'> | ||
<ul> | ||
<li>string</li> | ||
</ul> | ||
</dd> | ||
<dd>The user's meatspace name</dd> | ||
<dt>last_login</dt> | ||
<dd class='tags'> | ||
<ul> | ||
<li>iso8601</li> | ||
</ul> | ||
</dd> | ||
<dd>Date and time of the user's last login to github.com</dd> | ||
</dl> | ||
<h3>Links</h3> | ||
<dl class='attributes links'> | ||
<dt>organizations_href</dt> | ||
<dd class='tags'> | ||
<ul> | ||
<li>organization</li> | ||
</ul> | ||
</dd> | ||
<dd>[Organizations](#organization) of which this user is a public member</dd> | ||
<dt>emails_href</dt> | ||
<dd class='tags'> | ||
<ul> | ||
<li>email</li> | ||
</ul> | ||
</dd> | ||
<dd>The public [emails](#mail) registered to this user</dd> | ||
<dt>ssh_keys</dt> | ||
<dd class='tags'> | ||
<ul> | ||
<li>key</li> | ||
</ul> | ||
</dd> | ||
<dd>Public [SSH keys](#ssh_key) for this user</dd> | ||
</dl> | ||
<h3>Example</h3> | ||
<pre><code>{ | ||
"followers": 37, | ||
"type": "User", | ||
"gravatar_id": "d587890d0fcf8f45724baa8b1bfe1bf4", | ||
"hireable": false, | ||
"avatar_url": "https://secure.gravatar.com/avatar/d587890d0fcf8f45724baa8b1bfe1bf4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png", | ||
"blog": "blog.theamazingrando.com", | ||
"public_gists": 323, | ||
"bio": "The GitHub API Dude", | ||
"login": "paul", | ||
"following": 1, | ||
"company": "GitHub", | ||
"location": "Boulder, CO", | ||
"email": "psadauskas@gmail.com", | ||
"public_repos": 83, | ||
"created_at": "2008-02-11T18:44:09Z", | ||
"html_url": "https://github.com/paul", | ||
"name": "Paul Sadauskas", | ||
"url": "https://api.github.com/users/paul", | ||
"id": 184 | ||
}</code></pre> | ||
<h2 id='retrieve-current-user'>Retrieve current user</h2> | ||
<pre><code>GET /user</code></pre> | ||
<p class='alert'>Requires authentication</p> | ||
<p>You can use <code>/user</code> to get the currently logged in user. This is a shortcut to <code>/user/{login}</code> for<br> | ||
your particular login.</p> | ||
|
||
<pre lang="bash"><code>curl -u "paul:{{password}}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/user | ||
|
||
{ | ||
"html_url": "https://github.com/paul", | ||
"type": "User", | ||
"email": "psadauskas@gmail.com", | ||
"created_at": "2008-02-11T18:44:09Z", | ||
"blog": "blog.theamazingrando.com", | ||
"hireable": false, | ||
"collaborators": 3, | ||
"public_repos": 83, | ||
"followers": 37, | ||
"gravatar_id": "d587890d0fcf8f45724baa8b1bfe1bf4", | ||
"bio": "The GitHub API Dude", | ||
"public_gists": 323, | ||
"total_private_repos": 5, | ||
"disk_usage": 57572, | ||
"private_gists": 103, | ||
"following": 1, | ||
"company": "GitHub", | ||
"location": "Boulder, CO", | ||
"owned_private_repos": 5, | ||
"plan": { | ||
"collaborators": 100, | ||
"private_repos": 300, | ||
"name": "giga", | ||
"space": 62914560 | ||
}, | ||
"name": "Paul Sadauskas", | ||
"url": "https://api.github.com/users/paul", | ||
"avatar_url": "https://secure.gravatar.com/avatar/d587890d0fcf8f45724baa8b1bfe1bf4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png", | ||
"id": 184, | ||
"login": "paul" | ||
} | ||
|
||
</code></pre> | ||
|
||
<pre lang="ruby"><code>@github = GitHub::Client.new(token) | ||
@github.current_user | ||
|
||
-- No result, because I don't know what to do with "ruby" | ||
</code></pre> | ||
<h2 id='update-current-user'>Update current user</h2> | ||
<pre><code></code></pre> | ||
<p class='alert'>Requires authentication</p> | ||
<p>To update your user profile data, you can <code>PUT</code> (or <code>PATCH</code>) some the <a href="#user">user</a> attributes you want modified.</p> | ||
|
||
<pre lang="bash"><code>curl -u "paul:{{password}}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Content-Type: application/vnd.github.v3+json" \ | ||
-d '{"bio": "The GitHub API Dude"}' \ | ||
https://api.github.com/user | ||
|
||
{ | ||
"html_url": "https://github.com/paul", | ||
"type": "User", | ||
"email": "psadauskas@gmail.com", | ||
"created_at": "2008-02-11T18:44:09Z", | ||
"blog": "blog.theamazingrando.com", | ||
"hireable": false, | ||
"public_gists": 323, | ||
"followers": 37, | ||
"bio": "The GitHub API Dude", | ||
"gravatar_id": "d587890d0fcf8f45724baa8b1bfe1bf4", | ||
"total_private_repos": 5, | ||
"private_gists": 103, | ||
"collaborators": 3, | ||
"disk_usage": 57572, | ||
"owned_private_repos": 5, | ||
"public_repos": 83, | ||
"following": 1, | ||
"company": "GitHub", | ||
"location": "Boulder, CO", | ||
"avatar_url": "https://secure.gravatar.com/avatar/d587890d0fcf8f45724baa8b1bfe1bf4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png", | ||
"plan": { | ||
"private_repos": 300, | ||
"collaborators": 100, | ||
"name": "giga", | ||
"space": 62914560 | ||
}, | ||
"name": "Paul Sadauskas", | ||
"url": "https://api.github.com/users/paul", | ||
"id": 184, | ||
"login": "paul" | ||
} | ||
|
||
</code></pre> | ||
|
||
<p>The API will return 200 OK and the updated <a href="#user">user</a> in the response body, or an [error][#errors] if there was a problem.</p> | ||
<h2 id='fetch-user-by-login'>Fetch user by login</h2> | ||
<pre><code>GET /users/{login}</code></pre> | ||
<p>To lookup a particular user's public profile data, you can find them by their login name.</p> | ||
|
||
<pre lang="bash"><code>curl -H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/users/paul | ||
|
||
{ | ||
"html_url": "https://github.com/paul", | ||
"type": "User", | ||
"email": "psadauskas@gmail.com", | ||
"hireable": false, | ||
"created_at": "2008-02-11T18:44:09Z", | ||
"blog": "blog.theamazingrando.com", | ||
"public_repos": 83, | ||
"bio": "The GitHub API Dude", | ||
"followers": 37, | ||
"gravatar_id": "d587890d0fcf8f45724baa8b1bfe1bf4", | ||
"following": 1, | ||
"company": "GitHub", | ||
"location": "Boulder, CO", | ||
"name": "Paul Sadauskas", | ||
"url": "https://api.github.com/users/paul", | ||
"avatar_url": "https://secure.gravatar.com/avatar/d587890d0fcf8f45724baa8b1bfe1bf4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png", | ||
"id": 184, | ||
"public_gists": 323, | ||
"login": "paul" | ||
} | ||
|
||
</code></pre> | ||
|
||
<pre lang="ruby"><code>@github = GitHub::Client.new(token) | ||
@github.current_user | ||
|
||
-- No result, because I don't know what to do with "ruby" | ||
</code></pre> | ||
|
||
|
||
</div><!-- /#wrapper --> | ||
|
||
</body> | ||
</html> | ||
|
||
|
Oops, something went wrong.