Updated on 2024-01-31 GMT+08:00

Querying Customers (Old)

Function

This API is used to query your customers.

This API will be brought offline soon. For details about the API for querying the customer list, see Querying Customers.

Web UI

You can log in to the Partner Center to query your customers.

  1. Choose Customer Business > My Customers.
  2. Set search criteria to search for customers.

    You can search for customers by the association type, association time, customer name, salesperson name, expenditure this month, resource expiration date, mobile number, or customer tag.

REST API

This API is used to query your customers on the partner sales platform.

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

If a customer queried does not exist, the HTTP code 200 is returned by the API and an empty list is returned in the response.

  1. URI

    POST /v1.0/{partner_id}/partner/customer-mgr/query

    The following table describes the parameters.

    Parameter

    Mandatory

    Value Range

    Description

    partner_id

    Yes

    A maximum of 64 characters

    Partner ID (assigned by Huawei).

    For details about how to obtain the partner ID, see How Do I Check the Partner ID?

    The system does not verify this parameter.

  1. Request

    Request parameters

    Parameter

    Mandatory

    Type

    Value Range

    Description

    domainName

    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 Identity Management.

    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.

    name

    No

    String

    A maximum of 128 characters

    Real-name authentication name.

    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.

    offset

    No

    Intger

    [1- Maximum allowed integer]

    Page to be queried.

    By default, the first page is queried.

    limit

    No

    Intger

    [1-100]

    Number of records on each page.

    The default value is 10, and the maximum value is 100.

    label

    No

    String

    A maximum of 64 characters

    Tag. Fuzzy search is supported.

    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. 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.

    cooperationType

    No

    String

    A maximum of 1 character

    Association type.

    • 1: Referral
    • 2: Authorized Distributor
    • 3: indicates Reseller.

    Note:

    Currently, only Referral and Reseller are supported.

    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.

    cooperationTimeStart

    No

    String

    A maximum of 20 characters

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

    The value is in "yyyy-MM-dd 'T' HH:mm:ss 'Z'" format, such as 2019-05-06T08:05:01Z.

    This parameter must be used together with cooperationTimeEnd.

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

    cooperationTimeEnd

    No

    String

    A maximum of 20 characters

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

    The value is in "yyyy-MM-dd 'T' HH:mm:ss 'Z'" format, such as 2019-05-06T08:05:01Z.

    This parameter must be used together with cooperationTimeStart.

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

    Request Example

    POST https://bss-intl.myhuaweicloud.com/v1.0/{partner_id}/partner/customer-mgr/query HTTP/1.1
    Content-Type: application/json
    X-Auth-Token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ

  1. Response

    Response parameters

    Parameter

    Mandatory

    Type

    Value Range

    Description

    error_code

    No

    String

    A maximum of 16 characters

    Error code.

    For details, see 4.

    error_msg

    No

    String

    A maximum of 1024 characters

    Error description.

    customerInfoList

    No

    List<CustomerInfo>

    -

    Customer list.

    For details, see Table 1.

    count

    No

    Integer

    -

    Total number of records.

    Table 1 CustomerInfo

    Parameter

    Mandatory

    Type

    Value Range

    Description

    name

    No

    String

    A maximum of 128 characters

    Real-name authentication name.

    domainName

    Yes

    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.

    customerId

    Yes

    String

    A maximum of 64 characters

    Customer

    cooperationTime

    No

    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.

    cooperationType

    No

    String

    A maximum of 1 character

    Association type.

    • 1: Referral
    • 2: Authorized Distributor
    • 3: indicates Reseller.

    Note:

    Currently, only Referral and Reseller are supported.

    label

    No

    String

    A maximum of 64 characters

    Tag. Fuzzy search is supported.

    telephone

    No

    String

    A maximum of 20 characters

    Customer phone number.

    verifiedStatus

    No

    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.

    countryCode

    No

    String

    A maximum of 10 characters

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

    Example: 0086 for China

    customerType

    No

    Integer

    [-1,0,1]

    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.

    isFrozen

    No

    Integer

    [0,1]

    Whether to freeze the account.

    • 0: No
    • 1: Yes

    Example response

    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Content-Length: length
    Date: response time
    
    {
    	"count": 2,
    	"customerInfoList": [{
    			"name": "xxx",
    			"domainName": "a9ca*****b96",
    			"customerId": "05ad******4ea0",
    			"cooperationTime": "2019-07-19T06:40:53Z",
    			"cooperationType": "3",
    			"label": null,
    			"telephone": "17729386686",
    			"verifiedStatus": "2",
    			"countryCode": null,
                            "customerType":1
    		},
    		{
    			"name": "xxx",
    			"domainName": "a65b******89d",
    			"customerId": "059e******c6da0",
    			"cooperationTime": "2019-07-13T11:39:27Z",
    			"cooperationType": "3",
    			"label": null,
    			"telephone": null,
    			"verifiedStatus": "2",
    			"countryCode": null,
                            "customerType":1,
                            "isFrozen":0
    		}
    	]
    }

  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 Status Code

    Error Code

    Description

    200

    CBC.0000

    Success.

    500

    CBC.0999

    Other errors.

    400

    CBC.0100

    Incorrect parameter.

    403

    CBC.0151

    Access denied.