- Notifications
You must be signed in to change notification settings - Fork34
gogs/docs-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is a set of documents which describes Gogs REST API v1 usage, since it's still in early stage:
- Content of documentation and APIs are subject to change.
- We do not provide documentation in other languages.
- Aim to be in the format that is similar toGitHub REST API v3.
If you have any questions or concern, pleasefile an issue. 😊
The API is preinstalled with the base Gogs deployment. Seecurrent version andAPI source code for more details.
All Gogs APIs are underv1 using request path prefix/api/v1.
All data is sent and received as JSON unless specified otherwise.
HTTP/2 200content-type: application/json; charset=UTF-8date: Sat, 15 Dec 2018 01:55:28 GMTserver: Caddycontent-length: 175All timestamps return in RFC3339 format:
YYYY-MM-DDTHH:MM:SSZ2006-01-02T15:04:05Z07:00There are three ways to authenticate through Gogs API v1. Requests that require authentication will return404 Not Found, instead of403 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 only be used to obtain access tokens.
Personal access tokens are easier to manage and use, but except for few APIs (i.e. generate or get a access token), and they can be sent inheader orURL query.
$ curl -H "Authorization: token {ACCESS_TOKEN}" https://try.gogs.io/api/v1/user/repos$ curl https://try.gogs.io/api/v1/user/repos?token={ACCESS_TOKEN}You can specify further pages with the?page parameter.
curl https://try.gogs.io/api/v1/repos/unknwon/hello/issues?page=1Note that page numbering is 1-based and that omitting the?page parameter will return the first page.
TheLink header includes pagination information:
Link: <https://try.gogs.io/api/v1/repos/unknwon/hello/issues?page=3>; rel="next", <https://try.gogs.io/api/v1/repos/unknwon/hello/issues?page=50>; rel="last"The example includes a line break for readability.
This Link response header contains one or more Hypermedia link relations, some of which may require expansion as URI templates.
The possible rel values are:
| Name | Description |
|---|---|
next | The link relation for the immediate next page of results. |
last | The link relation for the last page of results. |
first | The link relation for the first page of results. |
prev | The link relation for the immediate previous page of results. |
- The style of documentation is heavily influenced byGitHub Developer.
About
A repository for Gogs API v1 documentation.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.