嘟哩開放平臺
简体中文
繁體中文
English
快速開始 開放接口 嘟哩官網
模板

創建用戶


請求說明

POST  http://[SERVER:9022]/v1/user/user_create?access_token={access_token}


請求參數

欄位

類型

是否必填

說明

access_token

string

Y

認證的token

org_id

string

Y

組織id

account

string

Y

用戶名(帳號,限制6-12比特英文或數位)

nick_name

string

Y

昵稱

phone

string

Y

手機號

password

string

N

密碼(默認為: a123456)

mobile_prefix

string

N

國碼(如,中國:86)

email

string

N

郵箱

display_in_org

boolean

N

是否展示到通訊錄

  • true: 是
  • false: 否

main_dept

string

N

主部門(多個部門中其中一個)

dept_ids

string[]

N

部門(一個員工可屬於多個部門)

post_id

string

N

崗位id

first_work_date

date

N

首次工作時間yyyy-MM-dd

join_date

date

N

入職時間yyyy-MM-dd

請求示例:

json

{
"org_id": "1000000",
"account": "200200021",
"nick_name": "xxxxxxx1",
"gender": 1,
"mobile_prefix":"86",
"phone": "",
"email": "1231414324@qq.com",
"display_in_org":true,
"main_dept":"1",
"dept_ids":["1","2"],
"post_id":"1",
"first_work_date":"",
"join_date":"",
}


返回結果示例

{
"code": 0,
"msg": "ok",
"data":
{
"org": "companyA",
"org_id":"1000000",
"account_id": "200200021", // 账号ID
"account": "kkk666",
"nick_name": "kingsley",
"status": "1",
"is_online": false,
"mobile_prefix":"86",
"phone": "13610117012",
"email": "13610117012@qq.com",
"gender": 1,
"avatar":"http://...",
"reg_time":"2024-12-12 15:53:07"
}
}

结果欄位說明

欄位

類型

說明

data


用戶列表

org

string

組織名稱

org_id

string

組織id

account_id

string

用戶id

account

string

用戶帳號

nick_name

string

昵稱

status

int

“1”:正常,“2”:禁用,“3”:離職

is_online

boolean

是否線上

  • true: 線上
  • false: 離線

mobile_prefix

int

手機號碼首碼:86

phone

string

手機號碼

email

string

郵箱

gender

int

性別,“1”:男,“2”:女

avatar

string

用戶頭像地址

reg_time

date

註冊時間yyyy-MM-dd HH: mm:ss


状态码說明

code

message

說明

100040

Invalid org id

無效的組織

100062

Invalid mobile number

無效的手機號

100063

email already exist error

郵箱已存在

100064

Invalid email

無效的郵箱

100111

Invalid account

無效的帳號

100140

Invalid nick name

無效的昵稱

100141

Invalid password

無效的密碼

100142

account already exist error

帳號已存在

100143

org account already exist error

多組織帳號已存在

100144

account dept is null

該帳號暫無部門(未指定用戶無法創建多組織帳號)

更多通用錯誤碼