嘟哩开放平台
简体中文
繁體中文
English
快速开始 开放接口 嘟哩官网
模板

用户


查询用户信息

请求说明


GET http://[SERVER:9022]/v1/user/get_user?access_token=$access_token&type={type}&query=
{account_id 或 account 或 phone}


请求参数

参数


类型

是否必填

说明

access_token

String

Y

认证的token

type

string


Y

查询类型,

当type=id查询条件query为账号ID,

当type=account查询条件query为账号account,

当type=phone查询条件query为手机号

query

string

Y

查询条件query为账号ID:query={account_id}

查询条件query为账号ID:query={account}

查询条件query为手机号:query={phone}

请求示例:

  1. 匹配查询账号ID

js

/v1/user?access_token=82e3e4re4a49b888d6b05r5t6yb7cd&type=id&query=200200021

  1. 匹配查询手机号

js

/v1/user?access_token=82e3e4re4a49b888d6b05r5t6yb7cd&type=phone&query=18899999999


返回结果示例

{
"code": 0,
"msg": "ok",
"data":{
"account_id": "200200021",
"account": "kingsley01",
"nick_name": "13610117012",
"status": 1,
"is_online": true,
"mobile_prefix":"86",
"phone": "13111111111",
"gender": 1,
"avatar":"http://...",
"reg_time":"2024-12-12 15:53:07",
"extenal": [
{
"org":"companyA",
"org_id":"1000000",
"email": "13111111111@qq.com",
"dept_list":[
{
"dept_name": "QA",
"dept_id": "1",
"is_dept_head":false
}
]
}
]
}
}

结果字段说明:

字段

类型

说明

account_id

string

用户id

account

string

用户账号

nick_name

string

用户名称

status

int

"1":正常,“2”:禁用,“3”:离职

is_online

boolean

是否在线

  • true:在线
  • false:离线

mobile_prefix

string

手机号前缀

phone

string

手机号码

gender

int

性别,"1":男,“2”:女

email

string[]

邮箱(支持多邮箱绑定)

avatar

string

用户头像地址

reg_time

date

用户创建/注册时间

extenal

string[]

[{

"org":"companyA", //所属组织(公司)

"org_id":"1000000", //

"email": "13111111111@qq.com",//邮箱

"dept_list": [

{

"dept_name": "QA", //部门名称

"dept_id": 1, //部门id

"is_dept_head":false //部门负责人,false:否,true:是

}]

}]


状态码说明

code

message

说明

100030

invalid user id

用户 ID 无效

100031

invalid query type

参数类型错误

通用错误码



2

system error

系统异常

100010

token expire

token已失效