Get a list of customers filtered by a search field

In this article

Gets a collection of Customer resources that match a filter. You can optionally set a page size. You can filter by company name, domain, indirect reseller, or indirect cloud solution provider (CSP).

Prerequisites

Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.

A user-constructed filter.

C#

To get a collection of customers that match a filter, first instantiate a SimpleFieldFilter object to create the filter. You'll need to pass a string that contains the CustomerSearchField, and indicate the type of filter operation as FieldFilterOperation.StartsWith. That's the only field filter operation supported by the customers end point. You'll also need to provide the string to filter by.

Next, instantiate an iQuery object to pass to the query by calling the BuildSimpleQuery method and passing it the filter. BuildSimplyQuery is just one of the query types supported by the QueryFactory class.

Response

If successful, this method returns a collection of matching Customer resources in the response body.

Response success and error codes

Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Partner Center REST error codes.

The feedback system for this content will be changing soon. Old comments will not be carried over. If content within a comment thread is important to you, please save a copy. For more information on the upcoming change, we invite you to read our blog post.