Skip to content
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
165 changes: 165 additions & 0 deletions api-reference/on-call.openapi.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -17322,6 +17322,95 @@
}
}
}
},
"/schedule/by-person": {
"post": {
"operationId": "scheduleByPerson",
"summary": "Get member on-call status",
"description": "Get a member's current and next on-call shifts and every enabled schedule they participate in.",
"tags": [
"On-call/Schedules"
],
"x-mint": {
"content": "## Restrictions\n\n| Aspect | Value |\n| ------ | ----- |\n| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |\n| Permissions | **Schedules Read** (`on-call`) or **Schedules Manage** (`on-call`) |\n\n## Usage\n\n- `current` carries the shift in progress with its true start time; `next` is the upcoming shift, absent when nothing is scheduled within the lookup window.\n- Disabled schedules are not listed.",
"href": "/en/api-reference/on-call/schedules/schedule-by-person",
"metadata": {
"sidebarTitle": "Get member on-call status"
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/SuccessEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ScheduleByPersonResponse"
}
}
}
]
},
"example": {
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"current": {
"schedule_id": 2539108069860,
"schedule_name": "Open Source Q&A",
"start_at": 1773446400,
"end_at": 1773532799
},
"next": {
"schedule_id": 2539108069860,
"schedule_name": "Open Source Q&A",
"start_at": 1773532800,
"end_at": 1773619199
},
"schedules": [
{
"schedule_id": 2539108069860,
"schedule_name": "Open Source Q&A"
}
]
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"500": {
"$ref": "#/components/responses/ServerError"
}
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScheduleByPersonRequest"
},
"example": {
"person_id": 2476444212131
}
}
}
}
}
}
},
"components": {
Expand Down Expand Up @@ -33346,6 +33435,82 @@
"title": "a_unack",
"description": "Detail payload for `a_unack` (historical). No fields.",
"properties": {}
},
"ScheduleByPersonRequest": {
"type": "object",
"description": "Member on-call status request",
"properties": {
"person_id": {
"type": "integer",
"description": "Member ID whose on-call status is returned.",
"format": "int64"
}
},
"required": [
"person_id"
]
},
"ScheduleByPersonResponse": {
"type": "object",
"description": "The member's on-call status: the shift in progress, the next one, and every enabled schedule they participate in.",
"properties": {
"current": {
"$ref": "#/components/schemas/MemberOncallInterval"
},
"next": {
"$ref": "#/components/schemas/MemberOncallInterval"
},
"schedules": {
"type": "array",
"description": "All enabled schedules the member participates in.",
"items": {
"$ref": "#/components/schemas/MemberScheduleItem"
}
}
},
"required": [
"schedules"
]
},
"MemberScheduleItem": {
"type": "object",
"description": "An enabled schedule the member participates in.",
"properties": {
"schedule_id": {
"type": "integer",
"description": "Schedule ID.",
"format": "int64"
},
"schedule_name": {
"type": "string",
"description": "Schedule name."
}
}
},
"MemberOncallInterval": {
"type": "object",
"description": "One on-call shift interval of a member.",
"properties": {
"schedule_id": {
"type": "integer",
"description": "Owning schedule ID.",
"format": "int64"
},
"schedule_name": {
"type": "string",
"description": "Owning schedule name."
},
"start_at": {
"type": "integer",
"description": "Unix timestamp in seconds - when the shift starts.",
"format": "int64"
},
"end_at": {
"type": "integer",
"description": "Unix timestamp in seconds - when the shift ends. Absent while the shift is ongoing.",
"format": "int64"
}
}
}
}
}
Expand Down
165 changes: 165 additions & 0 deletions api-reference/on-call.openapi.zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -17322,6 +17322,95 @@
}
}
}
},
"/schedule/by-person": {
"post": {
"operationId": "scheduleByPerson",
"summary": "查看成员值班状态",
"description": "查看某成员正在值班的班次、下一次值班以及其参与的全部启用排班。",
"tags": [
"On-call/值班排班"
],
"x-mint": {
"content": "## 限制说明\n\n| 项目 | 说明 |\n| ---- | ---- |\n| 速率限制 | 每个账户 **1,000 次/分钟**;**50 次/秒** |\n| 权限要求 | **值班查看**(`on-call`) 或 **值班管理**(`on-call`) |\n\n## 使用说明\n\n- `current` 为正在值班的班次(含真实开始时间);`next` 为下一次值班,查询窗口内没有排班时缺省。\n- 已禁用的排班不会出现在列表中。",
"href": "/zh/api-reference/on-call/schedules/schedule-by-person",
"metadata": {
"sidebarTitle": "查看成员值班状态"
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/SuccessEnvelope"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ScheduleByPersonResponse"
}
}
}
]
},
"example": {
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"current": {
"schedule_id": 2539108069860,
"schedule_name": "Open Source Q&A",
"start_at": 1773446400,
"end_at": 1773532799
},
"next": {
"schedule_id": 2539108069860,
"schedule_name": "Open Source Q&A",
"start_at": 1773532800,
"end_at": 1773619199
},
"schedules": [
{
"schedule_id": 2539108069860,
"schedule_name": "Open Source Q&A"
}
]
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"429": {
"$ref": "#/components/responses/TooManyRequests"
},
"500": {
"$ref": "#/components/responses/ServerError"
}
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScheduleByPersonRequest"
},
"example": {
"person_id": 2476444212131
}
}
}
}
}
}
},
"components": {
Expand Down Expand Up @@ -33346,6 +33435,82 @@
"title": "a_unack",
"description": "`a_unack` 的详情数据(历史),无字段。",
"properties": {}
},
"ScheduleByPersonRequest": {
"type": "object",
"description": "成员值班状态查询请求",
"properties": {
"person_id": {
"type": "integer",
"description": "要查询值班状态的成员 ID。",
"format": "int64"
}
},
"required": [
"person_id"
]
},
"ScheduleByPersonResponse": {
"type": "object",
"description": "成员的值班状态:正在值班的班次、下一次值班,以及其参与的全部启用排班。",
"properties": {
"current": {
"$ref": "#/components/schemas/MemberOncallInterval"
},
"next": {
"$ref": "#/components/schemas/MemberOncallInterval"
},
"schedules": {
"type": "array",
"description": "该成员参与的全部启用排班。",
"items": {
"$ref": "#/components/schemas/MemberScheduleItem"
}
}
},
"required": [
"schedules"
]
},
"MemberScheduleItem": {
"type": "object",
"description": "该成员参与的一个启用中的排班。",
"properties": {
"schedule_id": {
"type": "integer",
"description": "排班 ID。",
"format": "int64"
},
"schedule_name": {
"type": "string",
"description": "排班名称。"
}
}
},
"MemberOncallInterval": {
"type": "object",
"description": "成员的一个值班班次区间。",
"properties": {
"schedule_id": {
"type": "integer",
"description": "所属排班 ID。",
"format": "int64"
},
"schedule_name": {
"type": "string",
"description": "所属排班名称。"
},
"start_at": {
"type": "integer",
"description": "Unix 时间戳(秒)—— 班次开始时间。",
"format": "int64"
},
"end_at": {
"type": "integer",
"description": "Unix 时间戳(秒)—— 班次结束时间。值班进行中时缺省。",
"format": "int64"
}
}
}
}
}
Expand Down
Loading
Loading