top
关闭

开发者登录

用户信息类接口

主要使用场景:用户信息类接口

1、用户信息

基础 需要授权

根据用户编号获取用户信息,也支持按需返回少量字段

前置条件

获取接口访问令牌:accessToken

请求说明

urlhttps://api.wuhaneduyun.cn/user/openapi/user/get-user-info?user_id=xxx
请求方式get
是否需要鉴权
请求数限制
接口方向第三方应用->开放平台

参数说明

序号 字段名 约束 类型 长度 说明

1

user_id

必选

string

-

用户编号

2

return_keys

可选

string

-

指定返回的字段名称(多个逗号分隔,例如name,gender)

返回说明

序号 字段名 约束 类型 长度 说明

1

code

必选

string

-

结果编码

2

message

必选

string

-

结果描述

3

result

必选

json

-

结果对象

3.1

user_id

必选

string

-

用户id

3.2

platform_code

必选

string

-

平台编号

3.3

v_platform_code

必选

string

-

虚拟平台编号(多值用逗号分隔)

3.4

name

必选

string

-

用户姓名

3.5

gender

必选

int

-

性别(0:女,1:男,2:未填,3:保密)

3.6

birthdate

必选

string

-

出生日期

3.7

status

必选

int

-

状态(0:未激活, 1:正常, 2:注销, 3:锁定, 4:安管锁定)

3.8

province_code

必选

string

-

所在省

3.9

city_code

必选

string

-

所在市

3.10

area_code

必选

string

-

所在区

3.11

user_family

必选

json

-

用户家庭关系,学生绑定家长或家长绑定学生

3.11.1.1

top_org_id

必选

string

-

废弃字段,返回空

3.11.1.2

bind_user_id

必选

string

-

被绑定的用户id

3.11.1.3

relation_name

必选

string

-

绑定的称谓

3.11.1.4

relation_type

必选

string

-

绑定的家庭关系(正数时:被绑定的是家长,负数时:被绑定的是学生)

3.12

user_org

必选

json

-

用户所属部门、班级等节点

3.12.1.1

org_id

必选

string

-

用户所属部门、班级等节点id

3.12.1.2

top_org_id

必选

string

-

部门、班级所属的机构、学校id

3.12.1.3

org_type

必选

string

-

组织类型,区分出部门、班级等 系统字段说明

3.12.1.4

attr

必选

json

-

用户在部门、班级等节点里的独立属性数据

3.12.1.5

createtime

必选

int

-

用户加入部门、班级等节点时间戳

3.12.1.6

updatetime

必选

int

-

用户在部门、班级等节点发生数据更新的时间戳

3.12.1.7

org_name

必选

string

-

用户所在部门、班级等节点名称

3.12.1.8

top_org_name

必选

string

-

用户所在机构、学校的名称

3.12.1.9

top_school_id

必选

string

-

仅在当前节点是校区、学段、年级、班级时返回所在的校区id

3.12.1.10

top_school_name

必选

string

-

仅在当前节点是校区、学段、年级、班级时返回所在的校区名称

3.13

user_top_org

必选

json

-

用户所属机构、学校等组织

3.13.1

attr

必选

json

-

废弃字段,返回空数据

3.13.2

name

必选

string

-

用户在所属组织里的名称

3.13.3

org_type

必选

string

-

用户所属组织的组织类型

3.13.4

user_type

必选

string

-

用户在所属组织的用户类型

3.13.5

org_id

必选

string

-

用户所属组织的组织id

3.13.6

top_org_name

必选

string

-

用户所属组织的组织名称

3.14

user_role

必选

json

-

用户在组织里的岗位权限信息

3.14.1

parent_id

必选

string

-

有数字和字符串两种值,为数字类型时,为系统设置的默认角色,如1为主管理员,2为子管理员
为字符串类型时,表示组织内自定义岗位 系统字段说明

3.14.2

role_id

必选

string

-

自定义角色/岗位id

3.14.3

top_org_id

必选

string

-

角色/岗位所属机构、学校等组织id

3.14.4

org_id

必选

string

-

角色/岗位所属部门id

3.14.5

role_type

必选

string

-

废弃字段

3.14.6

_power

必选

json

-

子管理员权限信息,包含部门管理范围、基础权限、应用权限三个部分

3.14.6.1

power_value

必选

array

-

权限值

3.14.6.1

power_name

必选

string

-

权限类型

3.15

avatar

必选

json

-

用户头像(1:小, 2:中, 3:大)

3.16

last_top_org_id

必选

string

-

最后切换的机构、学校等组织编号

3.17

last_top_org_name

必选

string

-

最后切换的机构、学校等组织名称

3.18

last_user_type

必选

int

-

最后所属的用户类型

3.19

init_user_type

必选

int

-

用户初始注册用户类型(0学生,1老师,2家长等等)

3.20

init_v_platform_code

必选

string

-

用户初始虚拟平码编码

3.21

card_type

必选

int

-

用户证件类型 系统字段说明

3.22

account

必选

string

-

账号脱敏

3.23

phone

必选

string

-

手机号脱敏

3.24

education_id

必选

string

-

可信教育数字身份号(ESN)

示例

**请求示例**
https://api.wuhaneduyun.cn/user/openapi/user/get-user-info?user_id=xxx
**返回示例**
{
  "code": "000000",
  "message": "请求成功",
  "result": {
    "user_id": "xxxxxx",
    "platform_code": "420100",
    "v_platform_code": "420100,420101",
    "name": "lm650730",
    "gender": "2",
    "birthdate": "0",
    "status": "1",
    "province_code": "",
    "city_code": "",
    "area_code": "",
    "user_family": [],
    "user_org": [
      {
        "org_id": "xxx",
        "top_org_id": "xxx",
        "org_type": "4",//部门类型,有分配部门时
        "display_order": "0",
        "attr": [],
        "createtime": "1555394037",
        "updatetime": "1555394037",
        "org_name": "xx部门",
        "top_org_name": "xx小学"
      },
      {
        "org_id": "xxx",
        "top_org_id": "xxx",
        "org_type": "1",//当前为机构,用户没有分配部门时
        "display_order": "0",
        "attr": [],
        "createtime": "1557318193",
        "updatetime": "1557318193",
        "org_name": "xxx教育局",
        "top_org_name": "xxx教育局"
      },
      {
        "org_id": "xxx",
        "top_org_id": "xxx",
        "org_type": "2",//当前为学校,用户没有分配部门时
        "display_order": "0",
        "attr": [],
        "createtime": "1555385548",
        "updatetime": "1555385548",
        "org_name": "武汉小学",
        "top_org_name": "武汉小学"
      },
      {
        "org_id": "xxx",
        "top_org_id": "xxx",
        "org_type": "7",//当前为班级,有分配班级时
        "display_order": "0",
        "attr": [
			"class_monitor_student":1,//当为班级学生时,识别是否为班级班长
			"class_teacher_subject": [
				{
					"subject_id": "SUB7",//当为班级教师时,学科id
					"subject_type": 1,//学科类型,1基础学科,2自定义学科
					"school_period": 2//学科学段
				},
				{
					"subject_id": "SUB49",
					"subject_type": 1,
					"school_period": 2
				}
			],
			"class_header_teacher":1//当为班级教师时,识别是否为班主任
		],
        "createtime": "1555553403",
        "updatetime": "1555553403",
        "top_school_id": "xxx",
        "org_name": "五年级2班",
        "top_org_name": "xxx小学",
        "top_school_name": "xxx校区"
      }
    ],
    "user_top_org": [
      {
        "org_id": "xxx",
        "top_org_id": "xxx",
        "org_type": "1",//加入了机构
        "display_order": "1557318193",
        "name": "xxx",
        "user_type": "4",//用户在组织里的成员类型
        "attr": [],
        "createtime": "1557318193",
        "updatetime": "1557318193",
        "org_name": "xxx教育局",
        "top_org_name": "xxx教育局"
      },
      {
        "org_id": "xxx",
        "top_org_id": "xxx",
        "org_type": "2",//加入了学校
        "display_order": "1555385548",
        "name": "xxx",
        "user_type": "1",//用户在组织里的成员类型
        "attr": [],
        "createtime": "1555385548",
        "updatetime": "1557453305",
        "org_name": "xx小学",
        "top_org_name": "xx小学"
      }
    ],
    "user_role": [
      {
        "role_id": "xx",
        "parent_id": "2",//数字类型,系统岗位,2子管理员
        "role_type": "2",
        "org_id": "xxx",
        "top_org_id": "xxx",
        "createtime": "1555986367",
        "updatetime": "1555986367",
        "display_order": "0",
        "_power": [
			{
				"power_name":"sub_manager_department",
				"power_value":"["all"]",
				"role_id":"xxx",
				"createtime": "1555986367",
        		"updatetime": "1555986367",
			},
			{
				"power_name":"sub_manager_app",
				"power_value":"["1", "4"]",
				"role_id":"xxx",
				"createtime": "1555986367",
        		"updatetime": "1555986367",
			},
			{
				"power_name":"sub_manager_campus",
				"power_value":"["xxxx"]",
				"role_id":"xxx",
				"createtime": "1555986367",
        		"updatetime": "1555986367",
			}
		]
      },
      {
        "role_id": "xxx",
        "parent_id": "3",//数字类型,系统岗位
        "role_type": "2",
        "org_id": "xxx",
        "top_org_id": "xxx",
        "createtime": "1555394211",
        "updatetime": "1555394211",
        "display_order": "0",
        "_power": [
		]
      },
      {
        "role_id": "xxx",
        "parent_id": "ba56b1f4-600c-11e9-a949-0200f734321a",//字符串类型,自定义岗位
        "role_type": "2",
        "org_id": "xxx",
        "top_org_id": "xxx",
        "createtime": "1555394445",
        "updatetime": "1555395687",
        "display_order": "0",
        "_power": []
      }
    ],
    "last_top_org_id": "xxx",
    "last_top_org_name": "xx小学",
	"last_user_type": "1",
	"init_user_type": "1",
	"init_v_platform_code": "888880",
	"account": "a******d32",
	"phone": "133****8987",
	"education_id": "123456789"
  }
}