dingtalk.oapi.user.getuserinfo (通过免登码获取用户userid)

通过免登码获取用户userid

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
code String 可选 123456 requestAuthCode接口中获取的CODE

响应参数

名称 类型 示例值 描述
errcode Number 0 errcode
errmsg String ok errmsg
userid String userid
deviceId String deviceId
is_sys Boolean is_sys
sys_level String sys_level

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/getuserinfo");
OapiUserGetuserinfoRequest req = new OapiUserGetuserinfoRequest();
req.setCode("123456");
req.setHttpMethod("GET");
OapiUserGetuserinfoResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());

响应示例

  • JSON示例
{
    "errcode":0,
    "errmsg":"ok",
    "userid":"",
    "deviceId":"",
    "is_sys":,
    "sys_level":""
}

异常示例

  • JSON示例
{
	"error_response":{
		"msg":"Remote service error",
		"code":50,
		"sub_msg":"非法参数",
		"sub_code":"isv.invalid-parameter"
	}
}

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部