创建资源
POST
/api/v2/resources
请求参数
Header 参数
Authorization
string
Token
示例值:
Bearer sdfjosdfjsf
x-authing-userpool-id
string
用户池 ID
示例值:
61b95d6c96d42670da568408
Body 参数application/json
code
string
资源名称
actions
array [object {2}]
操作类型
name
string
动作,如:read
description
string
描述,如:读
type
enum<string>
资源类型
枚举值:
DATAAPIMENUUIBUTTON
description
string
资源描述
namespace
string
可选
apiIdentifier
string
可选
示例
{
"code": "string",
"actions": [
{
"name": "string",
"description": "string"
}
],
"type": "DATA",
"description": "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' \
--header 'Authorization: Bearer sdfjosdfjsf' \
--header 'x-authing-userpool-id: 61b95d6c96d42670da568408' \
--header 'Content-Type: application/json' \
--data-raw ''
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
必需
data
object
必需
userPoolId
string
必需
code
string
必需
actions
array [object {2}]
必需
type
string
必需
description
string
必需
namespaceId
integer
必需
apiIdentifier
string
必需
createdAt
string
必需
updatedAt
string
必需
id
string
必需
示例
{
"code": 200,
"message": "创建成功",
"data": {
"userPoolId": "61b95d6c96d42670da568408",
"code": "resource2",
"actions": [
{
"name": "read",
"description": "读"
},
{
"name": "write",
"description": "写"
}
],
"type": "BUTTON",
"description": "this is description",
"namespaceId": 5,
"apiIdentifier": "",
"createdAt": "2022-01-12T11:24:13.946Z",
"updatedAt": "2022-01-12T11:24:13.946Z",
"id": "61deba5d34c2ff025f31c582"
}
}
修改于 2022-01-12 11:54:10