-
Notifications
You must be signed in to change notification settings - Fork 148
Home
无闻 edited this page Aug 18, 2015
·
28 revisions
This is a set of documents which describes Gogs API usage, since it's still in early stage:
- Content of documentation is subject to change.
- We do not provide documentation in other languages.
If you have any questions or concern, please file an issue. 😊
All Gogs APIs are under v1 using request path prefix /api/v1.
There are three ways to authenticate through Gogs API v1. Requests that require authentication will return 404 Not Found, instead of 403 Forbidden, in some places. This is to prevent the accidental leakage of private repositories to unauthorized users.
$ curl -u "unknwon" https://try.gogs.io/api/v1/users/unknwon/tokensBasic authentication can be used for all Gogs APIs.
Personal access tokens are easier to manage and used, but are limited for few APIs(e.g. API to generate or get a access token), and they MUST be sent in header.
$ curl -H "Authorization: token ACCESS-TOKEN" https://try.gogs.io/api/v1/user/repos