用户资源

查询用户信息

1.接口说明

接口路径:/ac/openapi/v2/user

请求方式:GET

请求数据类型:

接口描述:查询平台用户基本信息

2.请求消息

请求参数:

Headers:

名称 类型 必填 描述 示例
tokenstring 接口凭证eyJhbGciOiJIUzI1N...

3.请求示例

cURL请求示例

curl --location 'https://api01.xxx.com:65102/ac/openapi/v2/user' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODYwMzY3NjA5NTQiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.f7nvKA2DqTsXjqF90zblMhwx0zKPpITY0uuSG2ouKG0'

Java请求示例

import okhttp3.*;

public class getUserInfoDemo {

    public static final String TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODY5MDg1MDkyMzEiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.U7pZKgO_K6NuRwOWPxblDfgRpGeVxS-BYieOdLhGDK4";

    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        Request request = new Request.Builder()
                .url("https://api01.xxx.com:65102/ac/openapi/v2/user")
                .method("GET", null)
                .addHeader("token", TOKEN)
                .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

Python请求示例

import requests

url = "https://api01.xxx.com:65102/ac/openapi/v2/user"

payload = {}
headers = {
  'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODYwMzY3NjA5NTQiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.f7nvKA2DqTsXjqF90zblMhwx0zKPpITY0uuSG2ouKG0'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

4.响应消息

返回参数

名称 类型 描述 示例
msgstring信息success
codestring状态码0
dataobject用户信息列表
countrystring国家China
timeZonestring时区(UTC+0800) China Standard Time
languagestring语言
userNamestring用户名test
fullNamestring全名测试用户
addressstring地址测试地址
accountStatusString账户状态Normal
accountNamestring账户名称test
accountBalancestring账户余额0.00
computerCenterstring区域OpenAPI计算中心

返回示例:

{
    "code": "0",
    "msg": "success",
    "data": {
        "country": "China",
        "language": "zh_CN",
        "timeZone": "(UTC+0800) China Standard Time",
        "address": "测试地址",
        "fullName": "测试用户",
        "userName": "test",
        "computerCenter": "OpenAPI计算中心",
        "accountName": "test",
        "accountStatus": "Normal",
        "accountBalance": "0.00"
    }
}

5.错误码

错误码 说明
10001 内部错误
10003 参数不全
10004 参数无效
10008 权限不足
10009 没有权限访问接口
10014 配额设置失败
601006 平台用户名已经存在, 请修改用户名重新尝试
622132 查询不到当前用户组管理员在计算中心下的用户组信息
622115 用户组名额已达上限,请申请增加用户组名额
0 接口调用成功

results matching ""

    No results matching ""