Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 补充平台开放接口与文档 #669

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions doc/zh/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

```json
{
"Authorization": "当前user的token"
"Authorization": "Token 当前user的token"
}
```

Expand All @@ -37,7 +37,7 @@ import requests
# 获取helloworld团队下的hellotca项目下登记的代码库
url="http://tca.com/server/main/api/orgs/helloworld/teams/hellotca/repos/?limit=12&offset=0"
headers = {
"Authorization": token,
"Authorization": "Token %s" % token,
}

response = requests.get(url, headers=headers)
Expand Down Expand Up @@ -115,3 +115,17 @@ print(response.json())
平台返回的数据分页格式是使用`limit`和`offset`参数进行分页处理

比如:`server/main/api/orgs/<org_sid>/teams/?limit=12&offset=12`获取得到的数据是从第 13 条开始获取

## 响应格式

平台返回的响应格式如下:


```JSON
{
"data": {...}, # 详细数据
"code": 0, # 请求结果码,为0表示正常
"msg": "xxx" , # 请求结果信息
"status_code": 200 # 请求响应码
}
```
Loading