PUT/api/v1/dev/apps/:appId/scopes变更应用申请的 scope
Try it 面板需要启用 JavaScript。
整体替换应用申请的 scope 列表;变更后重新进入审批流程(已批准的既有 scope 不受影响)。
Request
| Name | Data Type | Required | Description |
| Authorization | string | Yes | 会话令牌认证,格式 `Bearer <sessionToken>` |
| Content-Type | string | Yes | 请求体内容类型(默认值 "application/json") |
type RequestHeaders = {
/** 会话令牌认证,格式 `Bearer <sessionToken>` */
Authorization: string
/** 请求体内容类型,默认值 "application/json" */
Content-Type: string
}
{
"Authorization": "Bearer st_7c1f9e05b28d4a63",
"Content-Type": "application/json"
}
URL Parameters
| Name |
Data Type |
Description |
| appId |
string |
应用 ID |
Body
| Name | Data Type | Required | Description |
| scopes | array | Yes | 新的申请 scope 全集 |
type RequestBody = {
/** 新的申请 scope 全集 */
scopes: string[]
}
{
"scopes": [
"user:profile:read",
"orgs:list",
"subscriptions:read"
]
}
Response
Body
| Name | Data Type | Required | Description |
| appId | string | Yes | 应用 ID |
| scopes | array | Yes | 新的申请 scope |
| approvalStatus | string | Yes | 固定为 pending,等待重新审批 |
type ResponseBody = {
/** 应用 ID */
appId: string
/** 新的申请 scope */
scopes: string[]
/** 固定为 pending,等待重新审批 */
approvalStatus: string
}
{
"appId": "01JD8SNST2N5U6X1BU9YBHK4C7J",
"scopes": [
"user:profile:read",
"orgs:list",
"subscriptions:read"
],
"approvalStatus": "pending"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回新 scope 申请 |
| 400 |
scope 无效 |
含目录中不存在的 scope |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回新 scope 申请 |
| 2704 |
scope 无效 |
含目录中不存在的 scope |
Examples
PUT /api/v1/dev/apps/01JD8SNST2N5U6X1BU9YBHK4C7J/scopes
Authorization: Bearer st_7c1f9e05b28d4a63
Content-Type: application/json
{
"scopes": ["user:profile:read", "orgs:list", "subscriptions:read"]
}
{
"id": "01JD8SSOEJ3E1GZA",
"code": 0,
"messages": [],
"result": {
"appId": "01JD8SNST2N5U6X1BU9YBHK4C7J",
"scopes": ["user:profile:read", "orgs:list", "subscriptions:read"],
"approvalStatus": "pending"
}
}