Updated on 2024-02-22 GMT+08:00

Querying Customers

Function

This API is used to query your customers.

Visit Querying Customers to learn about how to query customers in Partner Center.

Constraints

This API can be invoked only by the partner AK/SK or token.

Debugging

You can debug the API in API Explorer which supports automatic authentication. API Explorer can automatically generate and debug example SDK code.

URI

POST /v2/partners/sub-customers/query

Request

Request parameters

Parameter

Mandatory

Type

Value Range

Description

account_name

No

String

A maximum of 64 characters

Account name. If the customer has created an IAM user, enter the account name of the master account. For details about the two concepts, see "Account" and "IAM User" in Basic Concepts.

Fuzzy search is supported. Only prefix, suffix, or middle part can be used for fuzzy search. The content you enter for fuzzy search cannot contain spaces.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

customer

No

String

A maximum of 64 characters

Name used by customer for real-name authentication, which can be queried using fuzzy search. Only prefix, suffix, or middle part can be used for fuzzy search. The content you enter for fuzzy search cannot contain spaces.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

offset

No

Integer

0 to 40,000,000

Offset, which starts from 0. The default value is 0.

NOTE:

This parameter is used for pagination. Retain its default value 0 if pagination is not required. offset indicates the offset relative to the first data record among all that meets the conditions configured. If you set offset to 1, the second and subsequent data records are returned.

For example, there are 10 data records, and if you set limit to 10 and offset to 1, the second to the tenth data records are returned.

limit

No

Integer

Maximum value: 100

Number of customers queried each time. The default value is 10.

label

No

String

A maximum of 64 characters

Tag. Fuzzy search is supported. Only prefix, suffix, or middle part can be used for fuzzy search. The content you enter for fuzzy search cannot contain spaces. The letters entered for search are case-sensitive.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

association_type

No

String

A maximum of 2 characters

Association type.

  • 1: Referral
  • 3: Reseller

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

associated_on_begin

No

String

A maximum of 20 characters

Start time of the association time range (UTC time).

Value format: YYYY-MM-DD'T'hh:mm:ss'Z', for example, 2019-05-06T08:05:01Z.

If this parameter is not included in the request parameters or is set to null, it cannot be used as a filter criterion.

associated_on_end

No

String

A maximum of 20 characters

End time of the association time range (UTC time).

Value format: YYYY-MM-DD'T'hh:mm:ss'Z', for example, 2019-05-06T08:05:01Z.

If this parameter is not included in the request parameters or is set to null, it cannot be used as a filter criterion.

customer_id

No

String

A maximum of 64 characters

Customer account ID. You can call the API for Querying Customers to obtain the value of this parameter, or you can obtain the value of the domain ID from the response of the API for Creating a Customer.

If this parameter is not included in the request parameters, is set to "", or is set to null, it cannot be used as a filter criterion.

indirect_partner_id

No

String

A maximum of 64 characters

Reseller ID. For details about how to obtain the ID, see Querying the List of Huawei Cloud Resellers. This parameter is mandatory for querying the list of customers of a Huawei Cloud reseller.

Example Request

POST https://bss-intl.myhuaweicloud.com/v2/partners/sub-customers/query HTTP/1.1
Content-Type: application/json
X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ
{
  "account_name": "betahc_kehu107",
  "customer": "sun***01",
  "offset": "0",
  "limit": "10",
  "label": "sunny",
  "association_type": "1",
  "associated_on_begin": "2019-05-06T08:05:01Z",
  "associated_on_end": "2019-05-06T08:05:01Z",
  "customer_id":"065024********e90f44c01cbccfa280",
  "indirect_partner_id": "si3fjg8ugf********"
}

Response

Response parameters

Parameter

Type

Value Range

Description

error_code

String

A maximum of 16 characters

Error code. This parameter is returned only when a failure occurs.

For details, see Returned Values.

error_msg

String

A maximum of 1024 characters

Error description. This parameter is returned only when a failure occurs.

customer_infos

List<CustomerInfo>

-

Customer list.

For details, see Table 1.

count

Integer

-

Total number of records.

Table 1 Customer information

Parameter

Type

Value Range

Description

customer

String

A maximum of 128 characters

Name that has passed the real-name authentication.

account_name

String

A maximum of 128 characters

Account name. If the customer has created an IAM user, the account name of the master account is returned.

customer_id

String

A maximum of 64 characters

Customer account ID.

associated_on

String

A maximum of 20 characters

Time when a customer is associated with a partner.

The value is UTC time in "yyyy-MM-dd 'T' HH:mm:ss 'Z'" format, such as 2019-05-06T08:05:01Z. HH ranges from 0 to 23, and mm and ss ranges from 0 to 59.

association_type

String

A maximum of 2 characters

Association type.

  • 1: Referral
  • 3: Reseller

label

String

A maximum of 64 characters

Tag.

telephone

String

A maximum of 20 characters

Customer phone number.

verified_status

String

A maximum of 5 characters

Real-name authentication status.

  • -1: The real name is not authenticated.
  • 0: Real-name authentication is under review.
  • 1: The real-name authentication is not passed.
  • 2: The real name is authenticated.

country_code

String

A maximum of 10 characters

Country code, which is the country code prefix of a phone number.

Example: 0086 for China

customer_type

Integer

-

Customer type.

  • -1: None
  • 0: Individual
  • 1: Enterprise

When a customer is registered, customerType is -1. The customer can set customerType in the account center or select the enterprise or individual real-name authentication to determine the customer type.

is_frozen

Integer

-

Whether to freeze the account.

  • 0: No
  • 1: Only account
  • 2: Account and resources

account_managers

List<AccountManager>

A maximum of 10 managers

Customer manager list. Only 1 account manager can be configured at present. For details, see Table 2.

xaccount_id

String

A maximum of 128 characters

Unique user ID on the partner sales platform. The ID is allocated by the partner.

xaccount_type

String

A maximum of 64 characters

Platform ID assigned by Huawei to a partner.

This value is assigned by Huawei. For details about how to obtain the platform ID, see How Do I Obtain the xaccountType Value?

customer_level

String

A maximum of 64 characters

Customer tier.

  • V0
  • V1
  • V2
  • V3
  • V4
  • V5
Table 2 AccountManager

Parameter

Type

Value Range

Description

account_name

String

A maximum of 128 characters

Name of the account manager.

Example Response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: length
Date: response time
{
  "customer_infos": [
    {
      "customer": "sun***01",
      "account_name": "betahc_kehu107",
      "customer_id": "0b11fa********870f20c003f6a53940",
      "associated_on": "2021-01-05T06:35:51Z",
      "association_type": "1",
      "label": "sunny",
      "telephone": "134****6666",
      "verified_status": "2",
      "country_code": "0086",
      "customer_type": "0",
      "is_frozen": "0",
      "account_managers": [
        {
          "account_name": "tan_ma"
        }
      ],
       "xaccount_id": "98**9707",
       "xaccount_type": "***_IDP",
       "customer_level": "V0"
    }
  ],
  "count": "1"
}

Returned Values

  • 4xx: This class of HTTP status code is intended for situations in which the error seems to have been caused by the client, for example, the request contains bad syntax or incorrect parameters. You must ensure the request is correct.
  • 5xx: This class of HTTP status code is intended for cases in which the Huawei Cloud server is aware that it has encountered an error or is otherwise incapable of performing the request. In this case, contact Huawei Cloud customer service.

HTTP Value

Error Code

Description

400

CBC.0100

Parameter error.

400

CBC.99000037

You do not have the permission to operate this Huawei Cloud reseller.

401

CBC.0154

Invalid or expired token.

403

CBC.0151

Access denied.

500

CBC.0999

Other errors.