-
Notifications
You must be signed in to change notification settings - Fork 1.2k
API WebHook
harupiyo edited this page Jan 2, 2021
·
48 revisions
The GitBucket api/webhook is designed for compatibility with GitHub's implementation.
The API endpoints are reachable under: http(s)://yourgitbucket/api/v3
GitBucket does not fully implement the GitHub API/webhook and respects only a subset of parameters. If you find some behavior different from GitHub, it can be a GitBucket bug or a feature not yet implemented :).
- personal OAUTH token in header
- The tokens can be created via the UI, by going into the "Account Settings" menu and selecting the "Applications" tab.
- Basic Authentication (since v4.3)
- OAuth2 Token (sent as a parameter) (since v4.31.0)
-
OAuth2 Key/Secretnot supported yet.
- Root Endpoint
- List endpoints (since v4.3, Only rate-limit endpoint explained)
- Issues
- List issues for a repository (since v4.9)
- Get an issue (since v4.8)
- Create an issue (since v4.9)
- Comments
- List issue comments
- Get an issue comment (since v4.35.0)
- Update an issue comment (since v4.35.0)
- Create an issue Comment
- Delete an issue comment (since v4.35.0)
- Labels
- List labels for a repository (since v3.11)
- Get a label (since v3.11)
- Create a label (since v3.11)
- Update a label (since v3.11)
- Delete a label (since v3.11)
- List labels for an issue (since v4.30)
- Add labels to an issue (since v4.30)
- Remove a label from an issue (since v4.30)
- Replace all labels for an issue (since v4.30)
- Remove all labels from an issue (since v4.30)
- Milestones
- List milestones (since v4.35.0)
- Create a milestone (since v4.35.0)
- Get a milestone (since v4.35.0)
- Update a milestone (since v4.35.0)
- Delete a milestone (since v4.35.0)
- Pull Requests
- List pull requests
- Create a pull request (since v4.30)
- Get a pull request
- Update a pull request (since v4.35.0)
- List commits on a pull request
- Check if a pull request has been merged (since v4.30)
- Merge a pull request (since v4.35.0)
- Repositories
- List public repositories (since v4.35.0)
- List repositories for the authenticated user
- List repositories for a user
- List organization repositories
- List repository tags (since v4.35.0)
- Get a repository
- Create a repository for the authenticated user
- Create an organization-repository
- Enabling and disabling branch protection (since v3.11)
- Status
- Branches
- List all branches for this repository (since v4.3)
- Get a branch (since v4.30)
- Get branch protection (since v4.35.0)
- Delete branch protection (since v4.35.0)
- Get status checks protection (since v4.35.0)
- Get all status check contexts (since v4.35.0)
- Commits
- List commits (since v4.34)
- List branches for HEAD commit (since v4.35.0)
- Get a commit (since v4.17)
- Contents
- Get a repository README (since v4.35.0)
- Get repository content (since v4.3)
- Create or update file contents (since v4.31)
- Reference
- Get a reference (since v4.3)
- Create a reference (since v4.35.0)
- Update a reference (since v4.35.0)
- Delete a reference (since v4.35.0)
- Collaborators
- List repository collaborators (since v4.3)
- Check if a user is a repository collaborator (since v4.35.0)
- Add user as a collaborator (since v4.30)
- Remove user as a collaborator (since v4.30)
- Get repository permissions for a user (since v4.35.0)
- Webhooks
- List repository webhooks (since v4.35.0)
- Create a repository webhook (since v4.35.0)
- Get a repository webhook (since v4.35.0)
- Update a repository webhook (since v4.35.0)
- Delete a repository webhook (since v4.35.0)
- Users
- Get a user
- Get the authenticated user
- Update the authenticated user (since v4.30)
- Get all users (since v4.30)
- List repositories for a user (since v4.3)
- Create a new user (since v4.30)
- Suspend a user (since v4.30)
- Unsuspend a user (v4.30)
- Groups
- List your groups (since v4.30)
- List all groups (since v4.30)
- Get an group (since v4.3)
- List repositories for this group (since v4.3)
- Create a new group (since v4.31.0)
With a default local installation, having created a token for the root
user, calling
curl -H "Authorization: token 6b690aa9e528c54835619b2cb717f61035e9a013" http://localhost:8080/api/v3/user
answers
{"login":"root","email":"root@localhost","type":"User","site_admin":true,"created_at":"2016-04-01T13:27:12Z","url":"http://localhost:8080/api/v3/users/root","html_url":"http://localhost:8080/root"}