| title | Users |
|---|
{: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 :username parameter then the response will be for the
logged in user (and you must pass authentication
information with your request).
GET /users/:username
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).
<%= headers 200 %> <%= json :full_user %>
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 => "octocat@github.com",
:blog => "https://github.com/blog",
:company => "GitHub",
:location => "San Francisco",
:hireable => true,
:bio => "There once..."
%>
<%= headers 200 %> <%= json :private_user %>
Lists all users, in the order that they signed up on {{ site.data.variables.product.product_name }}.
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] } %>