This repository has been archived by the owner on Nov 1, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync changes from upstream repository
- Loading branch information
Hubot
committed
Jun 16, 2016
1 parent
3293b3e
commit 40e5d04
Showing
6 changed files
with
156 additions
and
1 deletion.
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,28 @@ | ||
--- | ||
title: API changes for Repository Invitations | ||
author_name: CoralineAda | ||
--- | ||
|
||
We announced [repository invitation functionality][repo-invitations-announcement] on May 23. Using the site, you can invite collaborators to work on your repository. Invitees will receive an email with the invitation and have the option to accept or decline. | ||
|
||
We have now have endpoints for managing repository invitations for both repository administrators and invitation recipients through the GitHub API. You can enable these changes during the preview period by providing a custom [media type][media-type] in the `Accept` header: | ||
|
||
application/vnd.github.swamp-thing-preview | ||
|
||
For example: | ||
|
||
``` command-line | ||
curl "https://api.github.com/api/v3/repositories/1313/invitations" \ | ||
-H 'Authorization: token TOKEN' \ | ||
-H "Accept: application/vnd.github.swamp-thing-preview" \ | ||
``` | ||
|
||
You can learn more about the new endpoints in the updated [Collaborators][collaborators] and new [Repository Invitations][repo-invitations] documentation. | ||
|
||
If you have any questions or feedback, please [let us know][contact]. | ||
|
||
[media-type]: /v3/media | ||
[collaborators]: /v3/repos/collaborators | ||
[repo-invitations]: /v3/repos/invitations | ||
[repo-invitations-announcement]: https://github.com/blog/2170-repository-invitations | ||
[contact]: https://github.com/contact?form%5Bsubject%5D=Reactions+Repository+Invitations+API+Preview |
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
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
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,98 @@ | ||
--- | ||
title: Repository Invitations | ||
--- | ||
|
||
# Repository Invitations | ||
|
||
{{#tip}} | ||
|
||
We're currently offering a preview of the Repository Invitations API. | ||
|
||
To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header: | ||
|
||
``` | ||
application/vnd.github.swamp-thing-preview+json | ||
``` | ||
|
||
{{/tip}} | ||
|
||
{:toc} | ||
|
||
<a id="invite" /> | ||
|
||
## Invite a user to a repository | ||
|
||
Use the API endpoint for adding a collaborator [here](/v3/repos/collaborators). | ||
|
||
<a id="list" /> | ||
|
||
## List invitations for a repository | ||
|
||
GET /repositories/:repo_id/invitations | ||
|
||
When authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. | ||
|
||
### Response | ||
|
||
<%= headers 200, :pagination => default_pagination_rels %> | ||
<%= json(:repository_invitation) { |h| [h] } %> | ||
|
||
<a id="uninvite" /> | ||
|
||
## Delete a repository invitation | ||
|
||
DELETE /repositories/:repo_id/invitations/:invitation_id | ||
|
||
### Response | ||
|
||
<%= headers 204 %> | ||
|
||
<a id="update" /> | ||
|
||
## Update a repository invitation | ||
|
||
PATCH /repositories/:repo_id/invitations/:invitation_id | ||
|
||
### Input | ||
|
||
Name | Type | Description | ||
-----|------|-------------- | ||
`permissions`|`string` | The permissions that the associated user will have on the repository. Valid values are `read`, `write`, and `admin`. | ||
|
||
### Response | ||
|
||
<%= headers 200 %> | ||
<%= json(:repository_invitation) %> | ||
|
||
<a id="my-invitations" /> | ||
|
||
## List a user's repository invitations | ||
|
||
GET /user/repository_invitations | ||
|
||
When authenticating as a user, this endpoint will list all currently open repository invitations for that user. | ||
|
||
### Response | ||
|
||
<%= headers 200 %> | ||
<%= json(:repository_invitation) { |h| [h] } %> | ||
|
||
<a id="accept" /> | ||
|
||
## Accept a repository invitation | ||
|
||
PATCH /repositories/:repo_id/invitations/:invitation_id | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
### Response | ||
|
||
<%= headers 204 %> | ||
|
||
<a id="decline" /> | ||
|
||
## Decline a repository invitation | ||
|
||
DELETE /repositories/:repo_id/invitations/:invitation_id | ||
|
||
### Response | ||
|
||
<%= headers 204 %> |
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
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
Why is this the same url as the
Update a repository invitation
?