Authentication
Administrator. Session/administrative writes are not executed in the public Playground.
Endpoint
curl --request POST 'https://api.oneaster.ai/core/v1/admin/users' \ --header 'Authorization: Bearer '"$ONEASTER_SESSION_TOKEN" \ --header 'Content-Type: application/json' \ --data "$REQUEST_BODY_JSON"
Parameters
- page (query, Optional): {"type":"integer","minimum":1,"maximum":1000000,"default":1}
- size (query, Optional): {"type":"integer","minimum":1,"maximum":100,"default":20}
Request JSON Schema
{
"type": "object",
"additionalProperties": false,
"properties": {
"username": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9_.-]{2,63}$"
},
"password": {
"type": "string",
"minLength": 15,
"maxLength": 128,
"description": "服务端实际校验 UTF-8 字节长度。"
}
},
"required": [
"username",
"password"
]
}
Responses
201
邀请普通用户
{
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"success": {
"const": true
},
"data": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"pattern": "^[0-9]+$"
}
},
"required": [
"id"
]
}
},
"required": [
"success",
"data"
]
}
}
}
default
错误代码见 core-api.md;供应商/数据库错误已隐藏。
{
"application/json": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"success": {
"const": false
},
"error": {
"type": "object",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"type": {
"const": "oneaster_error"
}
},
"required": [
"code",
"message",
"type"
]
},
"data": {
"type": "null"
}
},
"required": [
"success",
"error",
"data"
]
}
}
}