Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b0c03b

Browse files
committed
Merge branch 'master' into api-notifications
2 parents7e51845 +7145ef9 commit8b0c03b

File tree

12 files changed

+148
-30
lines changed

12 files changed

+148
-30
lines changed

‎README.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,17 @@ We specify the JSON responses in ruby so that we don't have to write
5353
them by hand all over the docs. You can render the JSON for a resource
5454
like this:
5555

56-
<%= json :issue %>
56+
```erb
57+
<%= json :issue %>
58+
```
5759

5860
This looks up`GitHub::Resources::ISSUE` in`lib/resources.rb`.
5961

6062
Some actions return arrays. You can modify the JSON by passing a block:
6163

62-
<%= json(:issue) { |hash| [hash] } %>
64+
```erb
65+
<%= json(:issue) { |hash| [hash] } %>
66+
```
6367

6468
###Terminal blocks
6569

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
kind: change
3+
title: Rate limit changes for unauthenticated requests
4+
created_at: 2012-10-14
5+
author_name: pengwynn
6+
---
7+
8+
To ensure a high quality of service for all API consumers, we've reduced the
9+
default rate limit for unauthenticated requests. To enjoy the default rate
10+
limit of 5,000 requests per hour, you'll need to
11+
[authenticate](http://developer.github.com/v3/#authentication) via Basic Auth
12+
or OAuth. Unauthenticated requests will be limited to 60 per hour unless you
13+
[include your OAuth client and
14+
secret](http://developer.github.com/v3/#unauthenticated-rate-limited-requests).
15+
16+
We'll soon require all requests to include a valid [User Agent
17+
header](http://en.wikipedia.org/wiki/User_agent). Setting a
18+
unique value for this header helps us identify requests and get in touch with
19+
developers who are abusing the API. Most HTTP libraries, wrapper libraries, and
20+
even cURL provide a valid header for you already and allow you to change it to
21+
something unique to your application.
22+
23+
If you have any questions or feedback, please drop us a line at
24+
[support@github.com](mailto:support@github.com?subject=API Rate limit).
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
kind:change
3+
title:Organization Members Resource Changes
4+
created_at:2012-10-17
5+
author_name:pezra
6+
---
7+
8+
Requesting the[member list](/v3/orgs/members/index.html#members-list) of an
9+
organization of which you are not a member now redirects to the[public members
10+
list](v3/orgs/members/index.html#public-members-list). Similarly, requests to
11+
[membership check](/v3/orgs/members/index.html#check-membership) resources of
12+
an organization of which you are not a member are redirected to the equivalent
13+
[public membership check](/v3/orgs/members/index.html#check-public-membership).
14+
One exception to the latter case is that if you are checking about your own
15+
membership the request is not redirected. You are always allowed to know what
16+
organizations you belong to.
17+
18+
The changes where made to clarify the purpose of these various resources. The
19+
`/orgs/:org/members` resources are intended for use by members of the
20+
organization in question. The`/orgs/:org/public_members` resources are for
21+
acquiring information about the public membership of organizations. If you are
22+
not a member you are not allowed to see private membership information so you
23+
should be using the public membership resources.
24+
25+
If you have any questions or feedback, please drop us a line at
26+
[support@github.com](mailto:support@github.com?subject=Org members API).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
kind: change
3+
title: Set the default branch for a repository
4+
created_at: 2012-10-24
5+
author_name: pengwynn
6+
---
7+
8+
You can set the default branch for a repository to something other than 'master' from the GitHub repository admin screen:
9+
10+
![repo admin](/images/posts/default-branch.png)
11+
12+
Now, you can update this setting via the API. We've added a `default_branch` parameter to the [Edit Repository method][edit-repo]:
13+
14+
<preclass="terminal">
15+
curl -u pengwynn \
16+
-d '{"name": "octokit", "default_branch":"development"}' \
17+
https://api.github.com/repos/pengwynn/octokit
18+
</pre>
19+
20+
If you provide a branch name that hasn't been pushed to GitHub, we'll gracefully fall back to `'master'` or the first branch.
21+
22+
[edit-repo]: /v3/repos/#edit

‎content/v3.md‎

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,23 @@ domain (or through `yourdomain.com/api/v3/` for enterprise). All data is
1818
sent and received as JSON.
1919

2020
<preclass="terminal">
21-
$ curl -i https://api.github.com
21+
$ curl -i https://api.github.com/users/octocat/orgs
2222

23-
HTTP/1.1302 Found
24-
Server: nginx/1.0.12
25-
Date:Mon, 20 Feb 201211:15:49 GMT
26-
Content-Type:text/html;charset=utf-8
23+
HTTP/1.1200 OK
24+
Server: nginx
25+
Date:Fri, 12 Oct 201223:33:14 GMT
26+
Content-Type:application/json;charset=utf-8
2727
Connection: keep-alive
28-
Status: 302 Found
28+
Status: 200 OK
29+
ETag: "a00049ba79152d03380c34652f2cb612"
2930
X-RateLimit-Limit: 5000
30-
ETag: "d41d8cd98f00b204e9800998ecf8427e"
31-
Location: http://developer.github.com
32-
X-RateLimit-Remaining: 4999
33-
Content-Length: 0
31+
X-GitHub-Media-Type: github.beta
32+
X-RateLimit-Remaining: 4987
33+
Content-Length: 5
34+
Cache-Control: max-age=0, private, must-revalidate
35+
X-Content-Type-Options: nosniff
3436

37+
[]
3538
</pre>
3639

3740
Blank fields are included as`null` instead of being omitted.
@@ -120,8 +123,19 @@ already\_exists
120123
can happen in resources that must have some unique key (such as Label
121124
names).
122125

123-
If resources have custom validation errors, they will be documented with
124-
the resource.
126+
If resources have custom validation errors, they will be documented with the resource.
127+
128+
##HTTP Redirects
129+
130+
API v3 uses HTTP redirection where appropriate. Clients should assume that any request may result in a redirection. Receiving an HTTP redirection is*not* an error and clients should follow that redirect. Redirect responses will have a`Location` header field which contains the URI of the resource to which the client should repeat the requests.
131+
132+
301
133+
: Permanent redirection. The URI you used to make the request has be superseded by the one specified in the`Location` header field. This and all future requests to this resource should be directed the new URI.
134+
135+
302, 307
136+
: Temporary redirection. The request should be repeated verbatim to the URI specified in the`Location` header field but clients should continue to use the original URI for future requests.
137+
138+
Other redirection status codes may be used in accordance with the HTTP 1.1 spec.
125139

126140
##HTTP Verbs
127141

@@ -185,7 +199,7 @@ users.
185199
##Pagination
186200

187201
Requests that return multiple items will be paginated to 30 items by
188-
default. You can specify further pages with the`?page` parameter.For some
202+
default. You can specify further pages with the`?page` parameter. For some
189203
resources, you can also set a custom page size up to 100 with the`?per_page` parameter.
190204
Note that for technical reasons not all endpoints respect the`?per_page` parameter,
191205
see[events](http://developer.github.com/v3/events/) for example.
@@ -222,9 +236,10 @@ The possible `rel` values are:
222236

223237
##Rate Limiting
224238

225-
We limit requests to API v3 to 5000 per hour. This is keyed off either your
226-
login, your OAuth token, or request IP. You can check the returned HTTP
227-
headers of any API request to see your current status:
239+
We limit requests to 60 per hour for unauthenticated requests. For requests
240+
using Basic Authentication or OAuth, we limit requests to 5,000
241+
per hour. You can check the returned HTTP headers of any API request to see
242+
your current status:
228243

229244
<preclass="terminal">
230245
$ curl -i https://api.github.com/users/whatever
@@ -389,4 +404,3 @@ A link that looks like this:
389404
<%= json "Link" =>[
390405
["url1", {:rel => "next"}],
391406
["url2", {:rel => "foo",:bar => "baz"}]] %>
392-

‎content/v3/issues.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ filter
3333
*`created`: Issues created by you
3434
*`mentioned`: Issues mentioning you
3535
*`subscribed`: Issues you're subscribed to updates for
36+
*`all`: All issues the authenticated user can see, regardless of particpation or creation
3637

3738
state
3839
:`open`,`closed`, default:`open`

‎content/v3/libraries.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@ GitHub v3 API. Builds are available in [Maven Central](http://search.maven.org/
9292
*[github3.py][github3py]
9393
*[sanction][sanction]
9494
*[agithub][agithub]
95+
*[githubpy][githubpy]
9596

9697
[jacquev6_pygithub]:https://github.com/jacquev6/PyGithub
9798
[pygithub3-api]:https://github.com/copitux/python-github3
9899
[libsaas]:https://github.com/ducksboard/libsaas
99100
[github3py]:https://github.com/sigmavirus24/github3.py
100101
[sanction]:https://github.com/demianbrecht/sanction
101102
[agithub]:https://github.com/jpaugh64/agithub"Agnostic Github"
103+
[githubpy]:https://github.com/michaelliao/githubpy
102104

103105
##Ruby
104106

‎content/v3/orgs/members.md‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ title: Organization Members | GitHub API
77
* TOC
88
{:toc}
99

10-
##List members
10+
##Members list
1111

1212
List all users who are members of an organization. A member is a user
13-
that belongs to at least 1 team in the organization. If the authenticated user is
14-
also a member of this organization then both concealed and public
15-
members will be returned. Otherwise only public members are returned.
13+
that belongs to at least 1 team in the organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. If the reqeuster is not a member of the organization the query will be redirected to the[public members list](#public-members-list).
1614

1715
GET /orgs/:org/members
1816

@@ -21,18 +19,32 @@ members will be returned. Otherwise only public members are returned.
2119
<%= headers 200 %>
2220
<%= json(:user) { |h|[h] } %>
2321

24-
##Get member
22+
###Response if requester is not an organization member
23+
24+
<%= headers 302, "Location" => "https://api.github.com/orgs/github/public_members" %>
25+
26+
##Check membership
27+
28+
Check if a user is, publicly or privately, a member of the organization.
2529

2630
GET /orgs/:org/members/:user
2731

28-
###Response if user is a member
32+
###Response ifrequester is an organization member anduser is a member
2933

3034
<%= headers 204 %>
3135

32-
###Response if user is not a member
36+
###Response if requester is an organization member and user is not a member
37+
38+
<%= headers 404 %>
39+
40+
###Response if requester is not an organization member and is inquiring about themselves
3341

3442
<%= headers 404 %>
3543

44+
###Response if requester is not an organization member
45+
46+
<%= headers 302,:Location => "https://api.github.com/orgs/github/public_members/pezra" %>
47+
3648
##Add a member
3749

3850
To add someone as a member to an org, you must add them to a
@@ -49,7 +61,7 @@ they will no longer have any access to the organization's repositories.
4961

5062
<%= headers 204 %>
5163

52-
##List publicmembers
64+
##Publicmembers list
5365

5466
Members of an organization can choose to have their membership
5567
publicized or not.
@@ -61,7 +73,7 @@ publicized or not.
6173
<%= headers 200 %>
6274
<%= json(:user) { |h|[h] } %>
6375

64-
##Get if a user is apublicmember
76+
##Checkpublicmembership
6577

6678
GET /orgs/:org/public_members/:user
6779

‎content/v3/repos.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ README. Default is `false`.
109109
gitignore\_template
110110
:_Optional_**string** - Desired language or platform[.gitignore
111111
template](https://github.com/github/gitignore) to
112-
apply._Ignored if`auto_init` parameter is not provided._
112+
apply. Use the name of the template without the extension. For example, "Haskell"
113+
_Ignored if`auto_init` parameter is not provided._
113114

114115
<%= json\
115116
:name => "Hello-World",
@@ -168,6 +169,9 @@ has\_downloads
168169
:_Optional_**boolean** -`true` to enable downloads for this
169170
repository,`false` to disable them. Default is`true`.
170171

172+
default\_branch
173+
:_Optional_**String** - Update the default branch for this repository.
174+
171175
<%= json\
172176
:name => "Hello-World",
173177
:description => "This is your first repo",

‎content/v3/repos/statuses.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ this specific sha - `http://ci.example.com/johndoe/my-repo/builds/sha`.
6161
description
6262
:_Optional_**string** Short description of the status
6363

64+
<%= json\
65+
:state => "success",
66+
:target_url => "https://example.com/build/status",
67+
:description => "The build succeeded!"
68+
%>
69+
6470
###Response
6571

6672
<%= headers 201,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp