User management

Updated at:

These APIs for organization member management are for standalone deployments only.

Query organization member list

  • API endpoint: /openapi/v2/organization/user (GET)

  • Description: Retrieves a paginated list of users in an organization.

  • Input parameters

    Parameter

    Type

    Description

    Required

    keyword

    String

    A keyword for fuzzy search by account name or nickname.

    This parameter searches the accountName and nickName fields.

    No

    pageNum

    int

    The page number.

    Default value: 1.

    No

    pageSize

    int

    The number of entries to return on each page.

    Default value: 10.

    No

  • Response parameters (If you use an SDK, this API returns only the data object.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call is successful.

    • Error codes that start with AE or OE: The call fails.

    message

    string

    The error message. Valid values:

    • success: The call is successful.

    • Other values: The error message returned when the call fails.

    success

    boolean

    Indicates whether the call succeeded. Valid values:

    • true: The call is successful.

    • false: The call fails.

    data

    object

    The paginated response object. The list of organization members is in the nested data array.

    • totalNum

    int

    The total count of entries.

    • totalPages

    int

    The total number of pages.

    • pageSize

    int

    The number of entries per page specified in the request.

    • pageNum

    int

    The page number.

    • data

    object []

    The list of organization members.

    accountId

    string

    The account ID.

    Example: b5d8fd9348cc4327****afb604

    userType

    int

    The type of the organization member. Valid values:

    • 1: developer

    • 2: viewer

    • 3: analyst

    Example: 1

    accountName

    string

    The account name.

    Example: xxxxxx@163.com

    accountType

    int

    The account type.

    nickName

    string

    The account nickname.

    Example: Test Account

    email

    string

    The email address.

    phone

    string

    The phone number.

    admin

    boolean

    Indicates whether the user is an administrator. Valid values:

    • true: The user is an administrator.

    • false: The user is not an administrator.

    Example: true

    Important

    This parameter is deprecated. Use the roleIdList parameter instead.

    authAdmin

    boolean

    Indicates whether the user is a permission administrator. Valid values:

    • true: The user is a permission administrator.

    • false: The user is not a permission administrator.

    Example: true

    Important

    This parameter is deprecated. Use the roleIdList parameter instead.

    userId

    string

    The user ID in Quick BI.

    Example: b5d8fd9348cc4327****afb604

    roleIdList

    List<long>

    A list of the user's organization role IDs. A user can have a maximum of three roles. This list includes, but is not limited to, the following preset roles:

    • 111111111: administrator (preset role)

    • 111111112: permission administrator (preset role)

    • 111111113: standard user (preset role)

    joinedDate

    long

    The timestamp when the user joined the organization.

    lastLoginTime

    long

    The timestamp of the user's last login.

    isDeleted

    boolean

    The user status:

    • false: active

    • true: inactive

    Available since standalone deployment v5.4.1.

  • Example response

    {
    	"traceId": "5d07a633-****-4c1e-8928-1c0aa177****",
    	"code": null,
    	"message": null,
    	"data": {
    		"next": null,
    		"pre": null,
    		"data": [{
    			"accountId": "4d9f22c4f15e****a1210313c3e4cb6e",
    			"authAdmin": false,
    			"accountName": "test_name",
    			"phone": null,
                "roleIdList":[111111111,111111112,111111113],
    			"nickName": "Test Account",
    			"accountType": 3,
    			"admin": false,
    			"userType": 1,
    			"userId": "4d9f22c4f15e****a1210313c3e4cb6e",
    			"email": null,
                "joinedDate": 1595575199000,
                "lastLoginTime": 1595575199000,
                "isDeleted": true
    		}],
    		"totalNum": 1,
    		"totalPages": 1,
    		"start": 0,
    		"pageSize": 10,
    		"orderBy": null,
    		"pageNum": 1,
    		"orderString": null
    	},
    	"success": true
    }
  • Java SDK example

    @Test
    public static void QueryUserList() throws SDKException {
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/organization/user")
                .setMethod(HttpMethod.GET);
        // Optional parameters
        //request.addParameter("keyword",1);
        //request.addParameter("pageNum", 1);
        //request.addParameter("pageSize", 10);
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Add an organization member

  • API endpoint: /openapi/v2/organization/user (POST)

  • Description: Adds an organization member to the organization associated with the provided AccessKey (AK).

  • Request body: The request body must be in JSON format, with the Content-Type header set to application/json;charset=UTF-8.

    Parameter

    Type

    Description

    Required

    accountId

    string

    The account ID from a third-party system.

    If this parameter is not provided, Quick BI automatically generates a userId.

    Available since standalone deployment v3.6.

    Note: The accountId must be unique. If the accountType is a Quick BI built-in account, this parameter is ignored and the system automatically generates a userId.

    Important

    Starting from standalone deployment v5.3.1, Quick BI no longer supports setting the userId to be the same as the accountId. The userId is always generated by the system.

    No

    accountName

    string

    The account name.

    Constraints: Maximum length of 50 characters.

    Note: The accountName must be unique.

    Yes

    accountType

    int

    The account type. Valid values:

    3: Quick BI built-in account.

    6: Third-party account, which is an account integrated with a third-party SSO system through protocols such as OAuth or SAML.

    Available since standalone deployment v3.12.1.

    Yes

    nickName

    string

    The nickname.

    Constraints: Must be unique, with a maximum length of 50 characters. Can contain Chinese characters, English letters, digits, and the special characters _, \, /, |, (, ), [, ].

    Yes

    admin

    boolean

    Specifies whether the user is an organization administrator.

    Note: This parameter is deprecated. It is ignored when the roleIdList parameter is provided.

    No

    authAdmin

    boolean

    Specifies whether the user is a permission administrator.

    Note: This parameter is deprecated. It is ignored when the roleIdList parameter is provided.

    No

    email

    string

    The user's email address.

    Constraints: Must be in a valid email format.

    No

    userType

    int

    The user type. Valid values: 1 (developer), 2 (visitor), 3 (analyst).

    Default value: 1.

    No

    phone

    string

    The phone number.

    Constraints: Must only contain digits (0-9) and the symbols: (, ), +, -.

    No

    roleIdList

    List<string>

    A list of up to three role IDs for predefined or custom organization roles to assign to the user. Predefined role IDs include:

    • 111111111: organization administrator (predefined role)

    • 111111112: permission administrator (predefined role)

    • 111111113: standard user (predefined role)

    No

  • Response parameters: When calling this API by using an SDK, only the data object is returned.

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The response code. Valid values:

    • 0: The request was successful.

    • Error codes that start with AE or OE: The request failed.

    message

    string

    The response message. Valid values:

    • success: The request was successful.

    • Other values: An error message if the request fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    object

    The details of the newly created user.

    • accountId

    string

    The account ID.

    Example: b5d8fd9348cc4327****afb604

    • userType

    int

    The user type of the organization member. Valid values:

    • 1: developer

    • 2: visitor

    • 3: analyst

    Example: 1

    • accountName

    string

    The account name.

    Example: xxxxxx@163.com

    • accountType

    int

    The account type.

    • nickName

    string

    The nickname.

    Example: John Smith

    • email

    string

    The email address.

    • phone

    string

    The phone number.

    • admin

    boolean

    Indicates whether the user is an organization administrator. Valid values:

    • true: The user is an organization administrator.

    • false: The user is not an organization administrator.

    Example: true

    • authAdmin

    boolean

    Indicates whether the user is a permission administrator. Valid values:

    • true: The user is a permission administrator.

    • false: The user is not a permission administrator.

    Example: true

    Available since standalone deployment v5.4.1.

    • userId

    string

    The user ID in Quick BI.

    Example: b5d8fd9348cc4327****afb604

  • Example response

    {
        "traceId":"308dc464-513b-****-bbe9-cd0d2fb9****",
        "code":null,
        "message":null,
        "data":{
            "accountId": "test_123", 
            "userType": 1,            
            "accountName":"new_testss12***@alibaba.com",
            "accountType":3,
            "nickName":"Test User 123s12",
            "email":"xxxxxx123@163.com",
            "phone":"188****1111",
            "admin":true,
            "authAdmin":true,
            "userId":"44e6a073b****002840df64d50b16455"
        },
        "success":true
    }
  • Java SDK example

    public void addUser() throws Exception {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/organization/user")
            .setMethod(HttpMethod.POST);
        
        JSONObject body = new JSONObject();
        body.put("accountName", "yubxx_202403152");
        body.put("nickName", "yubxxi_202403152");
        body.put("accountType", 3);
        body.put("userType", 1);
        
        JSONArray roleIdList = new JSONArray();
        roleIdList.add("111111111");
        roleIdList.add("111111112");
        body.put("roleIdList", roleIdList);
    
        request.setHttpContent(body.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON);
    
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Delete an organization user

  • api path: /openapi/v2/organization/user/{userId} (DELETE)

  • Input parameter: The userId path parameter.

  • Description: Deletes a user from the organization. This operation fails if the user is a workspace owner. This API is deprecated. See Force delete a user from an organization.

  • Response parameters (SDK calls to this API return only the data field):

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • Exception codes that start with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request was successful.

    • Other values: the error message returned if the request fails.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates the result of the operation. Valid values:

    • true: The operation was successful.

    • false: The operation failed.

  • Example response

    {
        "traceId":"2572dea3-2799-****-8e47-0cc1501bd59f",
        "code":null,
        "message":null,
        "data":true,   # true, the deletion was successful
        "success":true
    }
  • Java SDK example

    public static void DeleteUser() throws SDKException {
        String userId = "xxx";
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/organization/user/" + userId)
                .setMethod(HttpMethod.DELETE)
                .setHttpContentType(FormatType.JSON);
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Get user information by user ID

  • API path: /openapi/v2/organization/user/{userId} (GET)

  • Input parameter: The userId path parameter.

  • Description: Retrieves detailed information for a specific member in the current organization.

  • Response parameters (When using an SDK, only the data object is returned):

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request is successful.

    • Error codes that start with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request is successful.

    • Other values: an error message returned if the request fails.

    success

    boolean

    Indicates whether the request succeeded. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    object

    The detailed information about the user.

    • accountId

    string

    The account ID.

    Example: b5d8fd9348cc4327****afb604

    • userType

    int

    The user type. Valid values:

    • 1: Developer

    • 2: Visitor

    • 3: Analyst

    Example: 1

    • accountName

    string

    The account name.

    Example: xxxxxx@163.com

    • accountType

    int

    The account type.

    • nickName

    string

    The nickname.

    Example: Zhang San

    • email

    string

    The email address.

    • phone

    string

    The phone number.

    • admin

    boolean

    Indicates whether the user is an administrator. Valid values:

    • true: Yes

    • false: No

    Example: true

    Note This parameter is deprecated. Use the roleIdList parameter instead.

    • authAdmin

    boolean

    Indicates whether the user is a permission administrator. Valid values:

    • true: Yes

    • false: No

    Example: true

    Note This parameter is deprecated. Use the roleIdList parameter instead.

    • userId

    string

    The user ID in Quick BI.

    Example: b5d8fd9348cc4327****afb604

    • roleIdList

    List<long>

    A list of up to three organization role IDs, including but not limited to the following built-in roles:

    • 111111111: organization administrator (built-in role)

    • 111111112: permission administrator (built-in role)

    • 111111113: general user (built-in role)

  • Example response

    {
        "traceId":"6796a38f-3084-****-a103-a20bb6498431",
        "code":null,
        "message":null,
        "data":{
            "accountId": "test_123",    
            "userType": 1,            
            "accountName":"new_testss12***@alibaba.com",
            "accountType":"3",
            "nickName":"Test User 123s12",
            "email":"xxxxxx123@163.com",
            "phone":"188****0011",
            "admin":true,
            "authAdmin":true,
            "userId":"44e6a073b****002840df64d50b16455",
            "roleIdList":[111111111,656704594,795597636]
        },
        "success":true
    }
    Important
    • This API performs a tenant isolation check and returns an error if the specified userId does not exist or does not belong to the organization.

    • AE0150100004: The user is not in the organization

    • AE0150100003: The user does not exist.

    {
        "traceId":"e9418aae-2ba8-****-ae8b-ab681ef3dbf1",
        "code":"AE0150100004",   // error code
        "message":"The user is not in the organization.",  // error message
        "success":false
    }
  • Java SDK example:

    public static void QueryUserInfoByUserId() throws SDKException {
        String userId = "xxx";
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/organization/user/" + userId)
                .setMethod(HttpMethod.GET);
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Update organization member information

  • API endpoint:/openapi/v2/organization/user/{userId}    (PUT)

  • Description: Updates an organization member's nickname, email, phone number, or user role.

  • Request Parameters: The userId is a path parameter. Other parameters are in the request body.

  • Additional notes (since version 4.7.4):

    • If both admin and authAdmin are passed as null, the user role is not modified.

    • If you do not set admin or authAdmin to true, the member defaults to the standard user role.

    Parameter

    Type

    Description

    Required

    userId

    String

    The user ID.

    Yes

    admin

    boolean

    Determines if the member is an organization administrator. If provided, this parameter overwrites the member's existing user role.

    Important

    This parameter is deprecated and not recommended for use. It is ignored if the roleIdList parameter is also provided.

    No

    authAdmin

    boolean

    Determines if the member is an authorization administrator. If provided, this parameter overwrites the member's existing user role (available in standalone deployment v4.7.4 and later).

    Important

    This parameter is deprecated and not recommended for use. It is ignored if the roleIdList parameter is also provided.

    No

    nickName

    string

    The nickname.

    Maximum 50 characters. Allowed characters: Chinese characters, English letters, digits, and the following special characters: _, \, /, |, (, ), [, ].

    No

    userType

    int

    The user type. Valid values:

    1: developer

    2: viewer

    3: analyst

    The default value is 1.

    No

    email

    string

    A valid email address.

    No

    phone

    string

    The phone number.

    Can contain only digits (0-9) and the following special characters: (, ), +, -.

    No

    roleIdList

    List<string>

    A list of up to three predefined or custom role IDs to assign to the member. This parameter overwrites all existing roles. Valid values for predefined roles:

    • 111111111: organization administrator (predefined role)

    • 111111112: authorization administrator (predefined role)

    • 111111113: standard user (predefined role)

    No

    isDeleted

    boolean

    Specifies the user's status.

    • false: Active

    • true: Inactive

    No

  • Response parameters

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • An error code that starts with AE or OE indicates a failed request.

    message

    string

    The error message. Valid values:

    • success: The request was successful.

    • If the request fails, this field contains a detailed error message.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    The response data. If an SDK is used, only the content of this field is returned. Valid values:

    • true: The operation was successful.

    • false: The operation failed.

  • Example response

    {
        "traceId":"9bbd2088-6aeb-****-9ef3-082cc5a4f8f3",
        "code":null,
        "message":null,
        "data":true, 
        "success":true
    }
  • Java SDK example

    public static void UpdateUser() throws SDKException {
        HttpRequest request = HttpRequest.build()           .setUri("/openapi/v2/organization/user/{userId:.+}")
                .setMethod(HttpMethod.PUT);
        request.addParameter("admin","xxx");
        request.addParameter("authAdmin","xxx");
        request.addParameter("userType","xxx");
        request.addParameter("nickName","xxx");
        request.addParameter("email","xxx");
        request.addParameter("phone","xxx");
        JSONArray roleIdList = new JSONArray();
        roleIdList.add("111111111");
        //roleIdList.add("111111112");
        request.addParameter("roleIdList",roleIdList);
        String result = openApiClient.syncExecute(request);
    
        System.out.println(result);
    }

Check user membership

  • API endpoint: /openapi/v2/organization/user/{userId}/exist (GET)

  • Description: Checks if a user belongs to the organization. The response returns true or false to indicate membership.

  • Available since: standalone deployment 3.7

  • Input parameters:

    Parameter

    Type

    Description

    Required

    userId

    String

    Path parameter. The user ID.

    Yes

  • Response parameters: (The SDK returns only the data field)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • Error codes starting with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request was successful.

    • Other values: an error message for a failed request.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates if the user is a member of the organization. Valid values:

    • true: The user exists and belongs to the organization.

    • false: The user does not belong to the organization or does not exist.

  • Example response:

    {
        "traceId":"9bbd2088-6aeb-****-9ef3-082cc5a4f8f3",
        "code":null,
        "message":null,
        "data":true,    // true: The user is a member of the organization. false: The user is not a member or does not exist.
        "success":true
    }
  • Java SDK example:

    public static void CheckOrganizationMember() throws SDKException {
        String userId = "xxx";
        HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/organization/user/" + userId + "/exist")
                .setMethod(HttpMethod.GET);
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Query user information by third-party account

  • API endpoint: /openapi/v2/organization/user/queryByAccount (GET)

  • Description: Retrieves user details in Quick BI based on a third-party account ID or name. For example, you can use this operation to get the Quick BI user ID associated with a third-party account. You cannot retrieve account information by ID if the third-party account was created without an ID and the user has never logged in.

  • Available since: standalone deployment 3.8.3

  • Input parameters:

    Parameter

    Type

    Description

    Required

    account

    string

    The ID or name of the third-party account.

    Yes

    accountType

    integer

    The account type. Valid values:

    3: A Quick BI built-in account.

    6: A third-party account from a customer system integrated using protocols such as OAuth.

    Note: If two accounts of different types share the same account name, you must specify this parameter to avoid an error.

    No

  • Response parameters (When using an SDK, this call returns only the data object.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request was successful.

    • An error code starting with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request was successful.

    • Other values: An error message is returned for a failed request.

    success

    boolean

    Indicates whether the request was successful. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    object

    The detailed information about the user.

    • accountId

    string

    The account ID.

    Example: b5d8fd9348cc4327****afb604

    • userType

    int

    The user type of the organization member. Valid values:

    • 1: developer

    • 2: viewer

    • 3: analyst

    Example: 1

    • accountName

    string

    The account name.

    Example: xxxxxx@163.com

    • accountType

    int

    The account type.

    • nickName

    string

    The nickname of the account.

    Example: Zhang San

    • email

    string

    The email address.

    • phone

    string

    The phone number.

    • admin

    boolean

    Indicates whether the user is an administrator. Valid values:

    • true: Yes

    • false: No

    Example: true

    Note: This parameter is deprecated. Use the roleIdList parameter instead.

    • authAdmin

    boolean

    Indicates whether the user is a permissions administrator. Valid values:

    • true: Yes

    • false: No

    Example: true

    Note: This parameter is deprecated. Use the roleIdList parameter instead.

    • userId

    string

    The user ID in Quick BI.

    Example: b5d8fd9348cc4327****afb604

    • roleIdList

    List<long>

    A list of organization role IDs assigned to the user. The list can contain up to three role IDs and includes built-in roles such as:

    • organization administrator (built-in role): 111111111

    • permissions administrator (built-in role): 111111112

    • standard user (built-in role): 111111113

  • Example response

    {
        "traceId":"9bbd2088-****",
        "code":null,
        "message":null,
        "data":{
            "accountName":"wang***@163.com",
            "accountId":"125446***",
            "accountType": 3,
            "nickName":"张三163",
            "admin":true,
            "authAdmin":false,
            "userId":"78212ee***",
            "userType":1,
            "phone":"139****8888",
            "email":"877***@xx.com",
            "roleIdList":[111111111,656704594,795597636]
    
        },
        "success":true
    }
  • Java SDK example

    private static void QueryUserInfoByAccount() throws SDKException {
        HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/organization/user/queryByAccount")
            .setMethod(HttpMethod.GET);
        request.addParameter("account", "125446280***");
        // Optional parameter
        // request.addParameter("accountType", "3");
        String result = client.syncExecute(request);
        System.out.println(result);
    }

Force delete an organization member

  • API path: /openapi/v2/organization/user/forceDelete (DELETE)

  • API description: Forcibly removes a user from the current organization and transfers their resources to a specified resource recipient. If the resource recipient is not a member of the user's workspace, the system adds them to that workspace. However, the operation fails under the following conditions:

    • The user being removed is an organization owner.

    • The user being removed is a workspace owner, but the resource recipient is a workspace analyst or workspace viewer. This operation fails because these roles cannot be promoted to workspace owner, a promotion required for the resource transfer.

    • The user being removed and the resource recipient are in the same workspace, and the user's role has higher permissions than the recipient's. The permission hierarchy is: workspace administrator > workspace developer > workspace analyst > workspace viewer.

  • Input parameters: (Submitted as form parameters with content-type=application/x-www-form-urlencoded)

    Parameter

    Type

    Description

    Required

    userId

    String

    The ID of the user to remove.

    Yes

    transferUserId

    String

    The ID of the resource recipient. If not specified, resources are transferred to the workspace owner by default.

    No

  • Return parameters (When you call this API using an SDK, only the data object is returned.)

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The call was successful.

    • Error codes starting with AE or OE indicate a failed call.

    message

    string

    The error message. Valid values:

    • success: The call was successful.

    • Any other value is an error message that describes the failure.

    success

    boolean

    Indicates if the request succeeded.

    • true: The request was successful.

    • false: The request failed.

    data

    boolean

    Indicates if the user was successfully deleted.

    • true: The deletion was successful.

    • false: The deletion failed.

  • Example response

    {
        "traceId":"9bbd2088-6aeb-****-9ef3-082cc5a4f8f3",
        "code":null,
        "message":null,
        "data":true, 
        "success":true
    }
  • Java SDK example

    public static void ForceDeleteUser() throws SDKException {
      HttpRequest request = HttpRequest.build()
            .setUri("/openapi/v2/organization/user/forceDelete")
            .setMethod(HttpMethod.DELETE)
            .setHttpContentType(FormatType.FORM);
        request.addParameter("userId", "ad00a0ef3e7b42****");
        // Optional parameter
        // request.addParameter("transferUserId", "0bff580a24f14e***");
        String result = openApiClient.syncExecute(request);
        System.out.println(result);
    }

Query user ID by third-party account ID

  • API: /openapi/v2/organization/user/queryUserByMobileAccount   (GET)

  • Description: Queries the Quick BI user ID based on a bound third-party account ID.

  • Available since: standalone deployment v6.0.2

    Parameter

    Type

    Description

    Required

    mobileUserId

    String

    The user ID from the bound mobile client.

    • For DingTalk: The unionId of the DingTalk account.

    • For WeCom: The userId of the WeCom account.

    • For Lark: The userId of the Lark account.

    Note: You must obtain the mobileUserId from the APIs of DingTalk, WeCom, and Lark.

    Yes

    mobileType

    String

    The type of the bound mobile client.

    • For DingTalk: ding

    • For WeCom: corp_weixin

    • For Lark: feishu

    Yes

  • Return parameters (When calling this API with an SDK, only the data object is returned):

    Parameter

    Type

    Description

    traceId

    string

    The request ID.

    code

    string

    The error code. Valid values:

    • 0: The request succeeded.

    • Error codes that start with AE or OE: The request failed.

    message

    string

    The error message. Valid values:

    • success: The request succeeded.

    • Other values: the error message returned if the request fails.

    success

    boolean

    Indicates whether the request succeeded. Valid values:

    • true: The request succeeded.

    • false: The request failed.

    data

    object

    An object that contains user information associated with the bound third-party account.

    • boundUserId

    string

    The Quick BI user ID of the bound account.

    • thirdAccountName

    string

    The account name from the mobile client.

  • Example response:

    {
        "traceId": "f09d9c3*************80602",
        "code": "0",
        "message": "success",
        "data": {
                    "thirdAccountName": "test",
                    "boundUserId": "74f5527*********ebf278c8"
                },
        "success": true
    }
  • Java SDK example:

     @Test
      public void queryUserByMobileAccount() throws Exception {
          HttpRequest request = HttpRequest.build()
                .setUri("/openapi/v2/organization/user/queryUserByMobileAccount")
                  .setMethod(HttpMethod.GET).setHttpContentType(FormatType.FORM);
          request.addParameter("mobileUserId","wsF********BAiEiE");
          request.addParameter("mobileType","ding");
          String response = getOpenApiClient("test").syncExecute(request);
          System.out.println(response);
      }