# 通过access_token换取用户信息

TIP

发送需要申请的字段到 zhimuli@tencent.com进行申请(邮件同时也抄送至hongfuhuang@tencent.com,ronniewan@tencent.com,marshalyang@tencent.com),申请时需要注明应用 APPKEY、申请内容、应用名称、及应用使用场景

# 接口说明

host path method content-type
open.wecard.qq.com connect/oauth/get-user-info POST application/json

# 请求参数

{
  "access_token": "access_token"
}
参数 必填 类型 说明
access_token ✔️ string 用户授权有效凭证

# 响应参数

当正确的情况下,scope 为 snsapi_base 时返回

{
  "errcode": 0,
  "errmsg": "success",
  "ocode": "1011789061",
  "card_number": "20121503"
}

当正确的情况下,scope 为 snsapi_userinfo 或 snsapi_sso 时返回

{
  "errcode": 0,
  "errmsg": "success",
  "ocode": "1011789061",
  "card_number": "07302590",
  "name": "陈小明",
  "identity_type": "1",
  "grade": "2016",
  "college": "人居环境工程学院",
  "profession": " 工程造价",
  "class": "1班",
  "identity_title": "经理/总监/部长/本科生...",
  "gender": 1,
  "head_image": "",
  "organization": [2, 222, 496],
  "role": [1, 2],
  "campus": "东校区",
  "dorm_number": "至善园",
  "physical_chip_number": "xaqwecf",
  "physical_card_number": "fqweasd",
  "nation": "汉族",
  "birthday": "20020319",
  "origin_place": "深圳市",
  "graduated_school": "小碧中学",
  "address": "广东省深圳市",
  "contact_person": "陈大明",
  "contact_phone": "(+86)13800138000",
  "email": "6051351232@qq.com",
  "id_card": "44030520020319401X",
  "telephone": "(+86)13800138000",
  "start_at": "2019-10-14 00:00:00",
  "expire_at": "2019-10-18 00:00:00",
  "updated_at": "2019-10-16 00:00:00"
}

# data 中的参数说明

参数 类型 说明
ocode string 主体代码
card_number string 用户电子卡号/学工号
name string 用户姓名
identity_type int 身份类型,见成员身份类型列表
grade string 年级(需申请)
college string 学院(需申请)
profession string 专业(需申请)
class string 班级(需申请)
identity_title string 身份职称(需申请)
gender int 性别,0 为未知,1 为男,2 为女(需申请)
head_image string 头像(需申请)
organization array 用户所属组织架构 id 列表(需申请)
role array 用户所属角色 id 列表(需申请)
campus string 校区(需申请)
dorm_number string 宿舍号(需申请)
physical_chip_number string 物理芯片号(需申请)
physical_card_number string 物理卡号(需申请)
nation string 民族(需申请)
birthday string 生日(需申请)
origin_place string 生源地(需申请)
graduated_school string 毕业学校(需申请)
address string 地址(需申请)
contact_person string 联系人姓名(需申请)
contact_phone string 联系人手机号码(带区号)(需申请)
email string 用户邮箱(需申请)
id_card string 身份证(需申请)
telephone string 手机号码(带区号)(需申请)
start_at string 有效起始时间(需申请)
expire_at string 有效结束时间(需申请)
updated_at string 用户信息变更时间(需申请)