GET /api/v1/projects
GET
/api/v1/projects我参与的项目列表(按创建时间倒序)
请求示例
cURL
curl -X GET 'http://localhost:8080/api/v1/projects' \
-H 'Accept: application/json' \
-H 'X-API-Key: <PROJECT_API_KEY>'
# 也可使用登录会话:-H 'Authorization: Bearer <JWT>'JavaScript
const res = await fetch('http://localhost:8080/api/v1/projects', {
method: 'GET',
headers: {
'Accept': 'application/json',
'X-API-Key': '<PROJECT_API_KEY>'
},
});
const data = await res.json();Python
import requests
res = requests.get(
'http://localhost:8080/api/v1/projects',
headers={'Accept': 'application/json', 'X-API-Key': '<PROJECT_API_KEY>'}
)
print(res.json())响应
200成功
application/json
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"slug": {
"type": "string"
},
"description": {
"type": "string"
},
"created_by": {
"type": "string",
"format": "uuid"
},
"status": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
}
}
}
}401未认证或凭据无效
application/json
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "not_found"
},
"message": {
"type": "string",
"example": "资源不存在"
}
}
}在线调试
在线调试
凭证仅保存在当前页面内存中自定义请求 Header
