Edit

Share via


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
ReturnAdditionalFields The list of additional properties that you want included within each returned account. The additional field values enable you to get the latest features using the current version of Customer Management API, and in the next version the corresponding elements will be included by default.

This request element is optional.
AccountAdditionalField
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 the credentials of a user who has permissions to Microsoft Advertising accounts.

For more information see Authentication with OAuth.
string
DeveloperToken The developer token used to access the Bing Ads API.

For more information see Get a Developer Token.
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/v13">
    <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/v13">
      <Filter i:nil="false">ValueHere</Filter>
      <TopN>ValueHere</TopN>
      <ReturnAdditionalFields i:nil="false">ValueHere</ReturnAdditionalFields>
    </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/v13">
    <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/v13">
      <AccountInfoWithCustomerData xmlns:e227="https://bingads.microsoft.com/Customer/v13/Entities" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <e227:AccountInfoWithCustomerData>
          <e227:CustomerId d4p1:nil="false">ValueHere</e227:CustomerId>
          <e227:CustomerName d4p1:nil="false">ValueHere</e227:CustomerName>
          <e227:AccountId>ValueHere</e227:AccountId>
          <e227:AccountName d4p1:nil="false">ValueHere</e227:AccountName>
          <e227:AccountNumber d4p1:nil="false">ValueHere</e227:AccountNumber>
          <e227:AccountLifeCycleStatus>ValueHere</e227:AccountLifeCycleStatus>
          <e227:PauseReason d4p1:nil="false">ValueHere</e227:PauseReason>
          <e227:AccountMode d4p1:nil="false">ValueHere</e227:AccountMode>
        </e227: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,
	AccountAdditionalField? returnAdditionalFields)
{
	var request = new FindAccountsOrCustomersInfoRequest
	{
		Filter = filter,
		TopN = topN,
		ReturnAdditionalFields = returnAdditionalFields
	};

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

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

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

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

	$request = new FindAccountsOrCustomersInfoRequest();

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

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

Requirements

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