mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 03:26:06 +01:00
Page:
API WebHook
Pages
API WebHook
Backup
Basic configurations
Build
Community Plugins
Connect to H2 database
Deployment to JEE and Servlet containers
Docker
Enabling SSH access to repository
External database configuration
FAQ
Home
How to Close Reference issues and pull request
Importing existing repos
Install as a systemd Service
Installation on IIS with Tomcat
Installation on Mac
Installation on a Raspberry Pi
Installation on ubuntu 16.04 with oracle_java8 tomcat8 mysql proper apache_proxy
LDAP Authentication Settings
List of URL Formats
OpenID Connect Settings
Performance
Reverse proxy with Apache
Reverse proxy with Caddy
Reverse proxy with Nginx
Setup Jenkins GitHub Branch Source plugin
Setup Jenkins GitHub pull request builder plugin
Setup Jenkins Multibranch Pipeline and Organization
Setup Slack Integration
Tomcat8 configuration
Tracing and logging
Wishlist
Clone
48
API WebHook
harupiyo edited this page 2021-01-02 21:13:34 +09:00
Table of Contents
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 :).
Authentication
- 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.
API
- 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)
Example
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"}