| title | Users | GitHub API |
|---|
- TOC {:toc}
Many of the resources on the users API provide a shortcut for getting
information about the currently authenticated user. If a request URL
does not include a :user parameter then the response will be for the
logged in user (and you must pass authentication
information with your request).
GET /users/:user
<%= headers 200 %> <%= json :full_user %>
Note: The returned email is the user's publicly visible email address
(or null if the user has not specified a public email address in their profile).
GET /user
<%= headers 200 %> <%= json :private_user %>
PATCH /user
| Name | Type | Description |
|---|---|---|
name |
string |
The new name of the user |
email |
string |
Publicly visible email address. |
blog |
string |
The new blog URL of the user. |
company |
string |
The new company of the user. |
location |
string |
The new location of the user. |
hireable |
boolean |
The new hiring availability of the user. |
bio |
string |
The new short biography of the user. |
<%= json
:name => "monalisa octocat",
:email => "[email protected]",
:blog => "https://github.com/blog",
:company => "GitHub",
:location => "San Francisco",
:hireable => true,
:bio => "There once..."
%>
<%= headers 200 %> <%= json :private_user %>
This provides a dump of every user, in the order that they signed up for GitHub.
Note: Pagination is powered exclusively by the since parameter.
Use the Link header to get the URL for the next page of
users.
GET /users
| Name | Type | Description |
|---|---|---|
since |
string |
The integer ID of the last User that you've seen. |
<%= headers 200, :pagination => { :next => 'https://api.github.com/users?since=135' } %> <%= json(:user) { |h| [h] } %>