GetCustomersBy - accountsIQ/API-Wiki GitHub Wiki

The GetCustomersBy function retrieves an array of customers from an entity whose email addresses match at least one contained in the WSGetCustomersByQuery parameter.

Declaration

C#

public WSResult2OfArrayOfCustomer GetCustomersBy(string token, WSGetCustomersByQuery query)

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
query WSGetCustomersByQuery The object containing an 'Emails' property that provides the list of customer email addresses by which to filter

Example

C#

Integration_1_1 ws = new Integration_1_1();
String auth = ws.Login(entityID, partnerKey, userKey);

if (auth != null)
{
    var customerEmailAddresses = new string[]
    {
        "[email protected]",
        "[email protected]"
    };
    
    var query = new WSGetCustomersByQuery()
    {
        Emails = customerEmailAddresses
    };

    // Get the list of customers
    accountsIQ.WSResult2OfArrayOfCustomer customers = ws.GetCustomersBy(auth, query);
    Assert.IsNotNull(customers.Result);

    if (customers.Status == OperationStatus.Success)
    {
        foreach (Customer c in customers.Result)
        {
            Assert.IsTrue(customerEmailAddresses.Contains(c.Email));
        }
    }
    else
    {
        // Use the ErrorCode field to pinpoint the problem
    }

    Console.ReadLine();
}

See Also

⚠️ **GitHub.com Fallback** ⚠️