修改资源
POST
/api/v2/resources/{code}
请求参数
Path 参数
code
string
资源名称
示例值:
resource3
Header 参数
Authorization
string
必需
示例值:
Bearer token
x-authing-userpool-id
string
用户池 ID
示例值:
61b95d6c96d42670da568408
Body 参数application/json
description
string
资源描述
actions
array [object {2}]
操作类型
name
string
可选
description
string
可选
type
string
资源类型
namespace
string
权限组唯一标识
apiIdentifier
string
可选
示例
{
"description": "string",
"actions": [
{
"name": "string",
"description": "string"
}
],
"type": "string",
"namespace": "string",
"apiIdentifier": "string"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://core.authing.cn/api/v2/resources/resource3' \
--header 'Authorization: Bearer token' \
--header 'x-authing-userpool-id: 61b95d6c96d42670da568408' \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "string",
"actions": [
{
"name": "string",
"description": "string"
}
],
"type": "string",
"namespace": "string",
"apiIdentifier": "string"
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
id
string
必需
createdAt
string
必需
updatedAt
string
必需
userPoolId
string
必需
code
string
必需
actions
array [object {2}]
必需
type
null
必需
description
string
必需
namespaceId
integer
必需
apiIdentifier
null
必需
示例
{
"code": 200,
"message": "修改成功",
"data": {
"id": "61debb338a741ec3d5a8b1dd",
"createdAt": "2022-01-12T11:27:47.182Z",
"updatedAt": "2022-01-12T11:37:26.554Z",
"userPoolId": "61b95d6c96d42670da568408",
"code": "resource3",
"actions": [
{
"name": "read",
"description": "读"
},
{
"name": "write",
"description": "写"
}
],
"type": null,
"description": "wejwfwefi",
"namespaceId": 5,
"apiIdentifier": null
}
}
修改于 2022-01-14 10:45:22