【前台账号】新增¶
POST /api/v1/account/add
概述¶
Body 请求参数¶
参数名 | 类型 | 必选 | 说明 |
---|---|---|---|
username | string | Y | 登陆账号名(不存在exterId时, 该字段值唯一) 例子: test_wang 允许为空: True 允许空字符串: True |
password | string | Y | 登陆密码(密码为空字符串时,第三方登录账号应设置密码未空字符串) 例子: I am password 允许空字符串: True 允许为空: True |
name | string | Y | 昵称 例子: test_wang 允许为空: False 允许空字符串: False |
string | Y | 用户邮箱 例子: test_wang@xx.com 允许为空: False 允许空字符串: True $isEmail: True |
|
mobile | string | 手机号 例子: 1762xxx9836 允许为空: False 允许空字符串: False |
|
exterId | string | 第三方账号系统的唯一标识ID, 当前字段存在时,该字段值唯一(username 字段允许重复) 例子: 29ab8d31-ac52-4485-a572-f4cf25d355d9 允许为空: False 允许空字符串: False |
|
extend | json | 额外信息 允许为空: True |
|
language | string | 语言信息 例子: zh 允许为空: True 允许空字符串: True 可选值: ['zh', 'en'] |
|
isDisable | boolean | 是否禁用 例子: True 允许为空: False 可选值: [True, False] |
|
attributes | json | 账号的属性信息(json结构, KV结构, V部分尽量使用字符串) 例子: {'部门': 'A部门'} 允许为空: False |
参数补充说明¶
请求例子¶
curl 'http://127.0.0.1:5000/api/v1/account/add' \
-H 'Content-Type: application/json' \
-H 'X-Df-Access-Key: abcd' \
-H 'X-Df-Nonce: 4' \
-H 'X-Df-Signature: test123' \
-H 'X-Df-Timestamp: 1715321116' \
--data-raw $'{ "username": "lwc_xxxx_002@qq.com", "password": "xxx", "name": "lwc_xxxx_002", "email": "lwc_xxxx_002@qq.com"}'
响应¶
{
"code": 200,
"content": {
"attributes": {},
"canaryPublic": false,
"createAt": 1715322612,
"creator": "SYS",
"deleteAt": -1,
"email": "xxxx@qq.com",
"enableMFA": false,
"extend": null,
"exterId": "",
"id": 3026,
"isUsed": 0,
"language": "zh",
"mfaSecret": "*********************",
"mobile": "",
"name": "xxxx",
"nameSpace": "",
"status": 0,
"statusPageSubs": 0,
"timezone": "",
"tokenHoldTime": 604800,
"tokenMaxValidDuration": 2592000,
"updateAt": 1715322612,
"updator": "SYS",
"username": "xxxx@qq.com",
"uuid": "acnt_67792938b21148ff8f2b17afdbd92c27"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-9833FF30-E419-42E1-B999-047E609D4EE3"
}