Help Center > > API Reference> Customer Management> Customer Management> Querying Customers

Querying Customers

Updated at: Jun 28, 2021 GMT+08:00

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.

URI

POST /v2/partners/sub-customers/query

Request

Request parameters

Parameter

Mandatory

Type

Value Range

Description

account_name

No

String

A maximum of 128 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.

customer

No

String

A maximum of 128 characters

Name used by customer for real-name authentication, which can be queried using fuzzy search.

offset

No

Integer

0 to maximum integer

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.

association_type

No

String

A maximum of 2 characters

Association type.

  • 1: indicates Referral.
  • 3: indicates Reseller.

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.

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.

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": "sunny_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"
}

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: indicates Referral.
  • 3: indicates 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.
  • 3: Real-name authentication failed.

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: Yes

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": "sunny_01",
      "account_name": "betahc_kehu107",
      "customer_id": "0b11fa92f900d2870f20c003f6a53940",
      "associated_on": "2021-01-05T06:35:51Z",
      "association_type": "1",
      "label": "sunny",
      "telephone": "13411116666",
      "verified_status": "2",
      "country_code": "0086",
      "customer_type": "0",
      "is_frozen": "0",
      "account_managers": [
        {
          "account_name": "tan_ma"
        }
      ],
       "xaccount_id": "98989707",
       "xaccount_type": "d_1903_e777hanel",
       "customer_level": "V0"
    }
  ],
  "count": "1"
}

Returned Values

HTTP Value

Error Code

Description

400

CBC.0100

Parameter error.

400

CBC.5004

You do not have the operation permission to this customer.

401

CBC.0154

Invalid or expired token.

403

CBC.0151

Access denied.

500

CBC.0999

Other errors.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel