GetAccount Service Operation

 

Gets the details of an account.

Request | Response

Error Codes

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

Request Body

The GetAccountRequest object defines the elements of the request’s body. The elements must be in the same order as shown in the SOAP Request SOAP.

ElementDescriptionData Type
AccountIdThe identifier of the account to get.long
IncludeTaxDetailsDetermines whether or not the returned AdvertiserAccount should include the TaxId, TaxIdStatus, and BusinessAddress elements. By default, the elements are not returned. To include the TaxId, TaxIdStatus, and BusinessAddress elements, set the value of this element to True.

Note: The TaxId, TaxIdStatus, and BusinessAddress elements were added after Customer Management Version 9 became generally available, so IncludeTaxDetails is used to gate the new elements for forward compatibility. This element will be removed in the next version of the Customer Management API, and all properties of the AdvertiserAccount will be returned by default.
boolean

Request Headers

Set the required header elements for each service request. New customers are required to sign up for Bing Ads with a Microsoft Account, and to manage those accounts you must use OAuth. Existing users with legacy Bing Ads credentials may continue to specify the UserName and Password header elements. In future versions of the API, Bing Ads will transition exclusively to Microsoft Account authentication. For more information, see Getting Started With the Bing Ads API.

OAuth Authentication

These request headers are required for Managing User Authentication with OAuth.

ElementDescriptionData Type
AuthenticationTokenThe OAuth access token that represents a Microsoft Account user who has permissions to Bing Ads accounts.string
DeveloperTokenThe developer token used to access the Bing Ads API.string

Password Authentication

These request headers are required for legacy username and password authentication.

ElementDescriptionData Type
DeveloperTokenThe developer token used to access the Bing Ads API.string
PasswordThe Bing Ads user's sign-in password.string
UserNameThe Bing Ads user's sign-in user name. You must not set this element to a Microsoft account or email address. To authenticate a Microsoft account, use the AuthenticationToken header instead of UserName and Password.string

Request SOAP

The following example shows the complete request envelope.

<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/v9">
    <Action mustUnderstand="1">GetAccount</Action>
    <ApplicationToken i:nil="false"></ApplicationToken>
    <AuthenticationToken i:nil="false"></AuthenticationToken>
    <DeveloperToken i:nil="false"></DeveloperToken>
    <Password i:nil="false"></Password>
    <UserName i:nil="false"></UserName>
  </s:Header>
  <s:Body>
    <GetAccountRequest xmlns="https://bingads.microsoft.com/Customer/v9">
      <AccountId></AccountId>
      <IncludeTaxDetails i:nil="false"></IncludeTaxDetails>
    </GetAccountRequest>
  </s:Body>
</s:Envelope>

Response Body

ElementDescriptionData Type
AccountAn account object that contains information about the account, such as payment method, account type, and parent customer.Account

Response Header

ElementDescriptionData Type
TrackingIdThe identifier of the log entry that contains the details of the API call.string

Response SOAP

The following example shows the complete response envelope.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v9">
    <TrackingId p4:nil="false" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"></TrackingId>
  </s:Header>
  <s:Body>
    <GetAccountResponse xmlns="https://bingads.microsoft.com/Customer/v9">
      <Account xmlns:e13="https://bingads.microsoft.com/Customer/v9/Entities" p5:nil="false" p5:type="-- specify derived type here with the appropriate prefix --" xmlns:p5="http://www.w3.org/2001/XMLSchema-instance">
        <e13:AccountType></e13:AccountType>
        <e13:BillToCustomerId p5:nil="false"></e13:BillToCustomerId>
        <e13:CountryCode p5:nil="false"></e13:CountryCode>
        <e13:CurrencyType p5:nil="false"></e13:CurrencyType>
        <e13:AccountFinancialStatus p5:nil="false"></e13:AccountFinancialStatus>
        <e13:Id p5:nil="false"></e13:Id>
        <e13:Language p5:nil="false"></e13:Language>
        <ForwardCompatibilityMap xmlns:e14="http://schemas.datacontract.org/2004/07/System.Collections.Generic" p5:nil="false">
          <e14:KeyValuePairOfstringstring>
            <e14:key p5:nil="false"></e14:key>
            <e14:value p5:nil="false"></e14:value>
          </e14:KeyValuePairOfstringstring>
        </ForwardCompatibilityMap>
        <e13:LastModifiedByUserId p5:nil="false"></e13:LastModifiedByUserId>
        <e13:LastModifiedTime p5:nil="false"></e13:LastModifiedTime>
        <e13:Name p5:nil="false"></e13:Name>
        <e13:Number p5:nil="false"></e13:Number>
        <e13:ParentCustomerId></e13:ParentCustomerId>
        <e13:PaymentMethodId p5:nil="false"></e13:PaymentMethodId>
        <e13:PaymentMethodType p5:nil="false"></e13:PaymentMethodType>
        <e13:PrimaryUserId p5:nil="false"></e13:PrimaryUserId>
        <e13:AccountLifeCycleStatus p5:nil="false"></e13:AccountLifeCycleStatus>
        <e13:TimeStamp p5:nil="false"></e13:TimeStamp>
        <e13:TimeZone p5:nil="false"></e13:TimeZone>
        <e13:PauseReason p5:nil="false"></e13:PauseReason>
        <!--These fields are included if the i:type attribute is AdvertiserAccount-->
        <e13:AgencyContactName p5:nil="false"></e13:AgencyContactName>
        <e13:AgencyCustomerId p5:nil="false"></e13:AgencyCustomerId>
        <e13:SalesHouseCustomerId p5:nil="false"></e13:SalesHouseCustomerId>
        <e13:TaxId p5:nil="false"></e13:TaxId>
        <e13:TaxType p5:nil="false"></e13:TaxType>
        <e13:BackUpPaymentInstrumentId p5:nil="false"></e13:BackUpPaymentInstrumentId>
        <e13:BillingThresholdAmount p5:nil="false"></e13:BillingThresholdAmount>
        <e13:TaxIdStatus p5:nil="false"></e13:TaxIdStatus>
        <e13:BusinessAddress p5:nil="false">
          <e13:City p5:nil="false"></e13:City>
          <e13:CountryCode p5:nil="false"></e13:CountryCode>
          <e13:Id p5:nil="false"></e13:Id>
          <e13:Line1 p5:nil="false"></e13:Line1>
          <e13:Line2 p5:nil="false"></e13:Line2>
          <e13:Line3 p5:nil="false"></e13:Line3>
          <e13:Line4 p5:nil="false"></e13:Line4>
          <e13:PostalCode p5:nil="false"></e13:PostalCode>
          <e13:StateOrProvince p5:nil="false"></e13:StateOrProvince>
          <e13:TimeStamp p5:nil="false"></e13:TimeStamp>
        </e13:BusinessAddress>
      </Account>
    </GetAccountResponse>
  </s:Body>
</s:Envelope>

If the service operation fails, it throws a FaultException, which contains one or more of the Bing Ads API error data objects. For information about the fault detail objects, see Customer Management Error Data Objects and Handling Service Errors and Exceptions.The following are example error codes that the error objects can include when using this service operation. For all documented error codes, please see Bing Ads Operation Error Codes.

Code
105
108
Show: