Skip to content

Commit 23bec85

Browse files
authored
Merge pull request #669 from Lingghh/dev/update_api_doc_20221024
🎨 补充平台开放接口与文档
2 parents 1a67869 + bc762e5 commit 23bec85

5 files changed

Lines changed: 389 additions & 234 deletions

File tree

doc/zh/api/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
```json
1414
{
15-
"Authorization": "当前user的token"
15+
"Authorization": "Token 当前user的token"
1616
}
1717
```
1818

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

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

117117
比如:`server/main/api/orgs/<org_sid>/teams/?limit=12&offset=12`获取得到的数据是从第 13 条开始获取
118+
119+
## 响应格式
120+
121+
平台返回的响应格式如下:
122+
123+
124+
```JSON
125+
{
126+
"data": {...}, # 详细数据
127+
"code": 0, # 请求结果码,为0表示正常
128+
"msg": "xxx" , # 请求结果信息
129+
"status_code": 200 # 请求响应码
130+
}
131+
```

0 commit comments

Comments
 (0)