편집

다음을 통해 공유


SearchAccounts Service Operation - Customer Management

Searches for accounts that match the request criteria.

For example you can search for accounts that the current authenticated user can access.

Tip

Please see the Account Hierchy and User Permissions guide for an overview with examples.

Request Elements

The SearchAccountsRequest 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
Ordering Determines the order of results by the specified property of an account.

This request element is optional. You can specify up to one OrderBy element in the array. Additional elements are not supported and will be ignored by the service.

If you set the Field element of the OrderBy object to "Id", "Name", or "Number", the returned Accounts will be ordered by the account identifiers, names, or numbers accordingly.

This request element is optional.
OrderBy array
PageInfo Determines the index and size of results per page. Paging
Predicates Determines the conditions that all must be met to return accounts.

You must include exactly one predicate. If the predicate Field is set to "AccountLifeCycleStatus", then you must specify one additional predicate with the Field set to another value such as UserId.

For details about each supported predicate Field value see Predicate Remarks.
Predicate array
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

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 SearchAccountsResponse 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
Accounts A list of accounts that meet the request criteria. AdvertiserAccount 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">SearchAccounts</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <SearchAccountsRequest xmlns="https://bingads.microsoft.com/Customer/v13">
      <Predicates xmlns:e517="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e517:Predicate>
          <e517:Field i:nil="false">ValueHere</e517:Field>
          <e517:Operator>ValueHere</e517:Operator>
          <e517:Value i:nil="false">ValueHere</e517:Value>
        </e517:Predicate>
      </Predicates>
      <Ordering xmlns:e518="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e518:OrderBy>
          <e518:Field>ValueHere</e518:Field>
          <e518:Order>ValueHere</e518:Order>
        </e518:OrderBy>
      </Ordering>
      <PageInfo xmlns:e519="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e519:Index>ValueHere</e519:Index>
        <e519:Size>ValueHere</e519:Size>
      </PageInfo>
      <ReturnAdditionalFields i:nil="false">ValueHere</ReturnAdditionalFields>
    </SearchAccountsRequest>
  </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>
    <SearchAccountsResponse xmlns="https://bingads.microsoft.com/Customer/v13">
      <Accounts xmlns:e520="https://bingads.microsoft.com/Customer/v13/Entities" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <e520:AdvertiserAccount>
          <e520:BillToCustomerId d4p1:nil="false">ValueHere</e520:BillToCustomerId>
          <e520:CurrencyCode d4p1:nil="false">ValueHere</e520:CurrencyCode>
          <e520:AccountFinancialStatus d4p1:nil="false">ValueHere</e520:AccountFinancialStatus>
          <e520:Id d4p1:nil="false">ValueHere</e520:Id>
          <e520:Language d4p1:nil="false">ValueHere</e520:Language>
          <e520:LastModifiedByUserId d4p1:nil="false">ValueHere</e520:LastModifiedByUserId>
          <e520:LastModifiedTime d4p1:nil="false">ValueHere</e520:LastModifiedTime>
          <e520:Name d4p1:nil="false">ValueHere</e520:Name>
          <e520:Number d4p1:nil="false">ValueHere</e520:Number>
          <e520:ParentCustomerId>ValueHere</e520:ParentCustomerId>
          <e520:PaymentMethodId d4p1:nil="false">ValueHere</e520:PaymentMethodId>
          <e520:PaymentMethodType d4p1:nil="false">ValueHere</e520:PaymentMethodType>
          <e520:PrimaryUserId d4p1:nil="false">ValueHere</e520:PrimaryUserId>
          <e520:AccountLifeCycleStatus d4p1:nil="false">ValueHere</e520:AccountLifeCycleStatus>
          <e520:TimeStamp d4p1:nil="false">ValueHere</e520:TimeStamp>
          <e520:TimeZone d4p1:nil="false">ValueHere</e520:TimeZone>
          <e520:PauseReason d4p1:nil="false">ValueHere</e520:PauseReason>
          <e520:ForwardCompatibilityMap xmlns:e521="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
            <e521:KeyValuePairOfstringstring>
              <e521:key d4p1:nil="false">ValueHere</e521:key>
              <e521:value d4p1:nil="false">ValueHere</e521:value>
            </e521:KeyValuePairOfstringstring>
          </e520:ForwardCompatibilityMap>
          <e520:LinkedAgencies d4p1:nil="false">
            <e520:CustomerInfo>
              <e520:Id d4p1:nil="false">ValueHere</e520:Id>
              <e520:Name d4p1:nil="false">ValueHere</e520:Name>
            </e520:CustomerInfo>
          </e520:LinkedAgencies>
          <e520:SalesHouseCustomerId d4p1:nil="false">ValueHere</e520:SalesHouseCustomerId>
          <e520:TaxInformation xmlns:e522="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
            <e522:KeyValuePairOfstringstring>
              <e522:key d4p1:nil="false">ValueHere</e522:key>
              <e522:value d4p1:nil="false">ValueHere</e522:value>
            </e522:KeyValuePairOfstringstring>
          </e520:TaxInformation>
          <e520:BackUpPaymentInstrumentId d4p1:nil="false">ValueHere</e520:BackUpPaymentInstrumentId>
          <e520:BillingThresholdAmount d4p1:nil="false">ValueHere</e520:BillingThresholdAmount>
          <e520:BusinessAddress d4p1:nil="false">
            <e520:City d4p1:nil="false">ValueHere</e520:City>
            <e520:CountryCode d4p1:nil="false">ValueHere</e520:CountryCode>
            <e520:Id d4p1:nil="false">ValueHere</e520:Id>
            <e520:Line1 d4p1:nil="false">ValueHere</e520:Line1>
            <e520:Line2 d4p1:nil="false">ValueHere</e520:Line2>
            <e520:Line3 d4p1:nil="false">ValueHere</e520:Line3>
            <e520:Line4 d4p1:nil="false">ValueHere</e520:Line4>
            <e520:PostalCode d4p1:nil="false">ValueHere</e520:PostalCode>
            <e520:StateOrProvince d4p1:nil="false">ValueHere</e520:StateOrProvince>
            <e520:TimeStamp d4p1:nil="false">ValueHere</e520:TimeStamp>
            <e520:BusinessName d4p1:nil="false">ValueHere</e520:BusinessName>
          </e520:BusinessAddress>
          <e520:AutoTagType d4p1:nil="false">ValueHere</e520:AutoTagType>
          <e520:SoldToPaymentInstrumentId d4p1:nil="false">ValueHere</e520:SoldToPaymentInstrumentId>
          <e520:TaxCertificate d4p1:nil="false">
            <e520:TaxCertificateBlobContainerName d4p1:nil="false">ValueHere</e520:TaxCertificateBlobContainerName>
            <e520:TaxCertificates xmlns:e523="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
              <e523:KeyValuePairOfstringbase64Binary>
                <e523:key d4p1:nil="false">ValueHere</e523:key>
                <e523:value d4p1:nil="false">ValueHere</e523:value>
              </e523:KeyValuePairOfstringbase64Binary>
            </e520:TaxCertificates>
            <e520:Status d4p1:nil="false">ValueHere</e520:Status>
          </e520:TaxCertificate>
          <e520:AccountMode d4p1:nil="false">ValueHere</e520:AccountMode>
        </e520:AdvertiserAccount>
      </Accounts>
    </SearchAccountsResponse>
  </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<SearchAccountsResponse> SearchAccountsAsync(
	IList<Predicate> predicates,
	IList<OrderBy> ordering,
	Paging pageInfo,
	AccountAdditionalField? returnAdditionalFields)
{
	var request = new SearchAccountsRequest
	{
		Predicates = predicates,
		Ordering = ordering,
		PageInfo = pageInfo,
		ReturnAdditionalFields = returnAdditionalFields
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.SearchAccountsAsync(r), request));
}
static SearchAccountsResponse searchAccounts(
	ArrayOfPredicate predicates,
	ArrayOfOrderBy ordering,
	Paging pageInfo,
	ArrayList<AccountAdditionalField> returnAdditionalFields) throws RemoteException, Exception
{
	SearchAccountsRequest request = new SearchAccountsRequest();

	request.setPredicates(predicates);
	request.setOrdering(ordering);
	request.setPageInfo(pageInfo);
	request.setReturnAdditionalFields(returnAdditionalFields);

	return CustomerManagementService.getService().searchAccounts(request);
}
static function SearchAccounts(
	$predicates,
	$ordering,
	$pageInfo,
	$returnAdditionalFields)
{

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

	$request = new SearchAccountsRequest();

	$request->Predicates = $predicates;
	$request->Ordering = $ordering;
	$request->PageInfo = $pageInfo;
	$request->ReturnAdditionalFields = $returnAdditionalFields;

	return $GLOBALS['CustomerManagementProxy']->GetService()->SearchAccounts($request);
}
response=customermanagement_service.SearchAccounts(
	Predicates=Predicates,
	Ordering=Ordering,
	PageInfo=PageInfo,
	ReturnAdditionalFields=ReturnAdditionalFields)

Requirements

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

Request Url

https://clientcenter.api.bingads.microsoft.com/CustomerManagement/v13/Accounts/Search

Request Elements

The SearchAccountsRequest object defines the body and header elements of the service operation request.

Note

Unless otherwise noted below, all request elements are required.

Request Body Elements

Element Description Data Type
Ordering Determines the order of results by the specified property of an account.

This request element is optional. You can specify up to one OrderBy element in the array. Additional elements are not supported and will be ignored by the service.

If you set the Field element of the OrderBy object to "Id", "Name", or "Number", the returned Accounts will be ordered by the account identifiers, names, or numbers accordingly.

This request element is optional.
OrderBy array
PageInfo Determines the index and size of results per page. Paging
Predicates Determines the conditions that all must be met to return accounts.

You must include exactly one predicate. If the predicate Field is set to "AccountLifeCycleStatus", then you must specify one additional predicate with the Field set to another value such as UserId.

For details about each supported predicate Field value see Predicate Remarks.
Predicate array
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

Request Header Elements

Element Description Data Type
Authorization The OAuth access token that represents the credentials of a user who has permissions to Microsoft Advertising accounts. Please ensure that the token is prefixed with "Bearer ", this is necessary for proper authentication.

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

Response Body Elements

Element Description Data Type
Accounts A list of accounts that meet the request criteria. AdvertiserAccount 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 JSON

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

{
  "Predicates": [
    {
      "Field": "ValueHere",
      "Operator": "ValueHere",
      "Value": "ValueHere"
    }
  ],
  "Ordering": [
    {
      "Field": "ValueHere",
      "Order": "ValueHere"
    }
  ],
  "PageInfo": {
    "Index": IntValueHere,
    "Size": IntValueHere
  },
  "ReturnAdditionalFields": "ValueHere"
}

Response JSON

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

{
  "Accounts": [
    {
      "AccountFinancialStatus": "ValueHere",
      "AccountLifeCycleStatus": "ValueHere",
      "AccountMode": "ValueHere",
      "AutoTagType": "ValueHere",
      "BackUpPaymentInstrumentId": "LongValueHere",
      "BillingThresholdAmount": DecimalValueHere,
      "BillToCustomerId": "LongValueHere",
      "BusinessAddress": {
        "BusinessName": "ValueHere",
        "City": "ValueHere",
        "CountryCode": "ValueHere",
        "Id": "LongValueHere",
        "Line1": "ValueHere",
        "Line2": "ValueHere",
        "Line3": "ValueHere",
        "Line4": "ValueHere",
        "PostalCode": "ValueHere",
        "StateOrProvince": "ValueHere",
        "TimeStamp": "ValueHere"
      },
      "CurrencyCode": "ValueHere",
      "ForwardCompatibilityMap": [
        {
          "key": "ValueHere",
          "value": "ValueHere"
        }
      ],
      "Id": "LongValueHere",
      "Language": "ValueHere",
      "LastModifiedByUserId": "LongValueHere",
      "LastModifiedTime": "ValueHere",
      "LinkedAgencies": [
        {
          "Id": "LongValueHere",
          "Name": "ValueHere"
        }
      ],
      "Name": "ValueHere",
      "Number": "ValueHere",
      "ParentCustomerId": "LongValueHere",
      "PauseReason": "ValueHere",
      "PaymentMethodId": "LongValueHere",
      "PaymentMethodType": "ValueHere",
      "PrimaryUserId": "LongValueHere",
      "SalesHouseCustomerId": "LongValueHere",
      "SoldToPaymentInstrumentId": "LongValueHere",
      "TaxCertificate": {
        "Status": "ValueHere",
        "TaxCertificateBlobContainerName": "ValueHere",
        "TaxCertificates": [
          {
            "key": "ValueHere",
            "value": "ValueHere"
          }
        ]
      },
      "TaxInformation": [
        {
          "key": "ValueHere",
          "value": "ValueHere"
        }
      ],
      "TimeStamp": "ValueHere",
      "TimeZone": "ValueHere"
    }
  ]
}

Code Syntax

To call REST API through SDKs, you need to upgrade SDK to a certain version and configure the system parameters.The example syntax can be used with Bing Ads SDKs. See Bing Ads API Code Examples for more examples.

public async Task<SearchAccountsResponse> SearchAccountsAsync(
	IList<Predicate> predicates,
	IList<OrderBy> ordering,
	Paging pageInfo,
	AccountAdditionalField? returnAdditionalFields)
{
	var request = new SearchAccountsRequest
	{
		Predicates = predicates,
		Ordering = ordering,
		PageInfo = pageInfo,
		ReturnAdditionalFields = returnAdditionalFields
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.SearchAccountsAsync(r), request));
}
static SearchAccountsResponse searchAccounts(
	ArrayOfPredicate predicates,
	ArrayOfOrderBy ordering,
	Paging pageInfo,
	ArrayList<AccountAdditionalField> returnAdditionalFields) throws RemoteException, Exception
{
	SearchAccountsRequest request = new SearchAccountsRequest();

	request.setPredicates(predicates);
	request.setOrdering(ordering);
	request.setPageInfo(pageInfo);
	request.setReturnAdditionalFields(returnAdditionalFields);

	return CustomerManagementService.getService().searchAccounts(request);
}
static function SearchAccounts(
	$predicates,
	$ordering,
	$pageInfo,
	$returnAdditionalFields)
{

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

	$request = new SearchAccountsRequest();

	$request->Predicates = $predicates;
	$request->Ordering = $ordering;
	$request->PageInfo = $pageInfo;
	$request->ReturnAdditionalFields = $returnAdditionalFields;

	return $GLOBALS['CustomerManagementProxy']->GetService()->SearchAccounts($request);
}
response=customermanagement_service.SearchAccounts(
	Predicates=Predicates,
	Ordering=Ordering,
	PageInfo=PageInfo,
	ReturnAdditionalFields=ReturnAdditionalFields)