FindAccountsOrCustomersInfo Service Operation - Customer Management

Gets a list of the accounts and customers that match the specified filter criteria.

Request Elements

The FindAccountsOrCustomersInfoRequest object defines the body and header elements of the service operation request. The elements must be in the same order as shown in the Request SOAP.

Note

Unless otherwise noted below, all request elements are required.

Request Body Elements

Element Description Data Type
Filter The criteria to use to filter the list of accounts and customers. You can specify either an account name, account number, or customer name.

The filter value can contain a partial or full name or number. The operation includes the account or customer in the result if the name or number begins with the specified filter value.

The operation performs a case-insensitive comparison when it compares your filter value to the name or number. For example, if you specify "t" as the filter value, the list will include accounts and customers whose names begin with "t" or "T".

The operation filters first for accounts that match the filter criteria. If the number of accounts that match the filter criteria is less than the specified TopN value, the operation searches for customers whose name matches the filter criteria.

Setting this element to an empty string is the same as calling the GetAccountsInfo followed by calling the GetCustomersInfo.
string
TopN A nonzero positive integer that specifies the number of accounts to return in the result. You must specify a value from 1 through 5,000. int

Request Header Elements

Element Description Data Type
AuthenticationToken The OAuth access token that represents a Microsoft Account user who has permissions to Microsoft Advertising accounts. string
DeveloperToken The developer token used to access the Bing Ads API. string
Password This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string
UserName This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string

Response Elements

The FindAccountsOrCustomersInfoResponse object defines the body and header elements of the service operation response. The elements are returned in the same order as shown in the Response SOAP.

Response Body Elements

Element Description Data Type
AccountInfoWithCustomerData A list of AccountInfoWithCustomerData objects of the accounts and customers that match the specified filter criteria.

The objects contain information that identifies the account and customer. To get the complete details of an account in the list, access the AccountId element of the AccountInfoWithCustomerData object and use it to call GetAccount operation.

To get the complete details of a customer in the list, access the CustomerId element of the AccountInfoWithCustomerData object and use it to call GetCustomer.
AccountInfoWithCustomerData array

Response Header Elements

Element Description Data Type
TrackingId The identifier of the log entry that contains the details of the API call. string

Request SOAP

This template was generated by a tool to show the order of the body and header elements for the SOAP request. For supported types that you can use with this service operation, see the Request Body Elements reference above.

<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v12">
    <Action mustUnderstand="1">FindAccountsOrCustomersInfo</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <FindAccountsOrCustomersInfoRequest xmlns="https://bingads.microsoft.com/Customer/v12">
      <Filter i:nil="false">ValueHere</Filter>
      <TopN>ValueHere</TopN>
    </FindAccountsOrCustomersInfoRequest>
  </s:Body>
</s:Envelope>

Response SOAP

This template was generated by a tool to show the order of the body and header elements for the SOAP response.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v12">
    <TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
  </s:Header>
  <s:Body>
    <FindAccountsOrCustomersInfoResponse xmlns="https://bingads.microsoft.com/Customer/v12">
      <AccountInfoWithCustomerData xmlns:e387="https://bingads.microsoft.com/Customer/v12/Entities" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <e387:AccountInfoWithCustomerData>
          <e387:CustomerId d4p1:nil="false">ValueHere</e387:CustomerId>
          <e387:CustomerName d4p1:nil="false">ValueHere</e387:CustomerName>
          <e387:AccountId>ValueHere</e387:AccountId>
          <e387:AccountName d4p1:nil="false">ValueHere</e387:AccountName>
          <e387:AccountNumber d4p1:nil="false">ValueHere</e387:AccountNumber>
          <e387:AccountLifeCycleStatus>ValueHere</e387:AccountLifeCycleStatus>
          <e387:PauseReason d4p1:nil="false">ValueHere</e387:PauseReason>
        </e387:AccountInfoWithCustomerData>
      </AccountInfoWithCustomerData>
    </FindAccountsOrCustomersInfoResponse>
  </s:Body>
</s:Envelope>

Code Syntax

The example syntax can be used with Bing Ads SDKs. See Bing Ads API Code Examples for more examples.

public async Task<FindAccountsOrCustomersInfoResponse> FindAccountsOrCustomersInfoAsync(
	string filter,
	int topN)
{
	var request = new FindAccountsOrCustomersInfoRequest
	{
		Filter = filter,
		TopN = topN
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.FindAccountsOrCustomersInfoAsync(r), request));
}
static FindAccountsOrCustomersInfoResponse findAccountsOrCustomersInfo(
	java.lang.String filter,
	int topN) throws RemoteException, Exception
{
	FindAccountsOrCustomersInfoRequest request = new FindAccountsOrCustomersInfoRequest();

	request.setFilter(filter);
	request.setTopN(topN);

	return CustomerManagementService.getService().findAccountsOrCustomersInfo(request);
}
static function FindAccountsOrCustomersInfo(
	$filter,
	$topN)
{

	$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];

	$request = new FindAccountsOrCustomersInfoRequest();

	$request->Filter = $filter;
	$request->TopN = $topN;

	return $GLOBALS['CustomerManagementProxy']->GetService()->FindAccountsOrCustomersInfo($request);
}
response=customermanagement_service.FindAccountsOrCustomersInfo(
	Filter=Filter,
	TopN=TopN)

Requirements

Service: CustomerManagementService.svc v12
Namespace: https://bingads.microsoft.com/Customer/v12