GetAccount Service Operation - Customer Management
Gets the details of an account.
Request Elements
The GetAccountRequest 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 |
---|---|---|
AccountId | The identifier of the account to get. | long |
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 GetAccountResponse 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 |
---|---|---|
Account | An account object that contains information about the account, such as payment method, account type, and parent customer. | AdvertiserAccount |
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">GetAccount</Action>
<AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
<DeveloperToken i:nil="false">ValueHere</DeveloperToken>
</s:Header>
<s:Body>
<GetAccountRequest xmlns="https://bingads.microsoft.com/Customer/v13">
<AccountId>ValueHere</AccountId>
<ReturnAdditionalFields i:nil="false">ValueHere</ReturnAdditionalFields>
</GetAccountRequest>
</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>
<GetAccountResponse xmlns="https://bingads.microsoft.com/Customer/v13">
<Account xmlns:e479="https://bingads.microsoft.com/Customer/v13/Entities" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
<e479:BillToCustomerId d4p1:nil="false">ValueHere</e479:BillToCustomerId>
<e479:CurrencyCode d4p1:nil="false">ValueHere</e479:CurrencyCode>
<e479:AccountFinancialStatus d4p1:nil="false">ValueHere</e479:AccountFinancialStatus>
<e479:Id d4p1:nil="false">ValueHere</e479:Id>
<e479:Language d4p1:nil="false">ValueHere</e479:Language>
<e479:LastModifiedByUserId d4p1:nil="false">ValueHere</e479:LastModifiedByUserId>
<e479:LastModifiedTime d4p1:nil="false">ValueHere</e479:LastModifiedTime>
<e479:Name d4p1:nil="false">ValueHere</e479:Name>
<e479:Number d4p1:nil="false">ValueHere</e479:Number>
<e479:ParentCustomerId>ValueHere</e479:ParentCustomerId>
<e479:PaymentMethodId d4p1:nil="false">ValueHere</e479:PaymentMethodId>
<e479:PaymentMethodType d4p1:nil="false">ValueHere</e479:PaymentMethodType>
<e479:PrimaryUserId d4p1:nil="false">ValueHere</e479:PrimaryUserId>
<e479:AccountLifeCycleStatus d4p1:nil="false">ValueHere</e479:AccountLifeCycleStatus>
<e479:TimeStamp d4p1:nil="false">ValueHere</e479:TimeStamp>
<e479:TimeZone d4p1:nil="false">ValueHere</e479:TimeZone>
<e479:PauseReason d4p1:nil="false">ValueHere</e479:PauseReason>
<e479:ForwardCompatibilityMap xmlns:e480="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
<e480:KeyValuePairOfstringstring>
<e480:key d4p1:nil="false">ValueHere</e480:key>
<e480:value d4p1:nil="false">ValueHere</e480:value>
</e480:KeyValuePairOfstringstring>
</e479:ForwardCompatibilityMap>
<e479:LinkedAgencies d4p1:nil="false">
<e479:CustomerInfo>
<e479:Id d4p1:nil="false">ValueHere</e479:Id>
<e479:Name d4p1:nil="false">ValueHere</e479:Name>
</e479:CustomerInfo>
</e479:LinkedAgencies>
<e479:SalesHouseCustomerId d4p1:nil="false">ValueHere</e479:SalesHouseCustomerId>
<e479:TaxInformation xmlns:e481="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
<e481:KeyValuePairOfstringstring>
<e481:key d4p1:nil="false">ValueHere</e481:key>
<e481:value d4p1:nil="false">ValueHere</e481:value>
</e481:KeyValuePairOfstringstring>
</e479:TaxInformation>
<e479:BackUpPaymentInstrumentId d4p1:nil="false">ValueHere</e479:BackUpPaymentInstrumentId>
<e479:BillingThresholdAmount d4p1:nil="false">ValueHere</e479:BillingThresholdAmount>
<e479:BusinessAddress d4p1:nil="false">
<e479:City d4p1:nil="false">ValueHere</e479:City>
<e479:CountryCode d4p1:nil="false">ValueHere</e479:CountryCode>
<e479:Id d4p1:nil="false">ValueHere</e479:Id>
<e479:Line1 d4p1:nil="false">ValueHere</e479:Line1>
<e479:Line2 d4p1:nil="false">ValueHere</e479:Line2>
<e479:Line3 d4p1:nil="false">ValueHere</e479:Line3>
<e479:Line4 d4p1:nil="false">ValueHere</e479:Line4>
<e479:PostalCode d4p1:nil="false">ValueHere</e479:PostalCode>
<e479:StateOrProvince d4p1:nil="false">ValueHere</e479:StateOrProvince>
<e479:TimeStamp d4p1:nil="false">ValueHere</e479:TimeStamp>
<e479:BusinessName d4p1:nil="false">ValueHere</e479:BusinessName>
</e479:BusinessAddress>
<e479:AutoTagType d4p1:nil="false">ValueHere</e479:AutoTagType>
<e479:SoldToPaymentInstrumentId d4p1:nil="false">ValueHere</e479:SoldToPaymentInstrumentId>
<e479:TaxCertificate d4p1:nil="false">
<e479:TaxCertificateBlobContainerName d4p1:nil="false">ValueHere</e479:TaxCertificateBlobContainerName>
<e479:TaxCertificates xmlns:e482="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
<e482:KeyValuePairOfstringbase64Binary>
<e482:key d4p1:nil="false">ValueHere</e482:key>
<e482:value d4p1:nil="false">ValueHere</e482:value>
</e482:KeyValuePairOfstringbase64Binary>
</e479:TaxCertificates>
<e479:Status d4p1:nil="false">ValueHere</e479:Status>
</e479:TaxCertificate>
<e479:AccountMode d4p1:nil="false">ValueHere</e479:AccountMode>
</Account>
</GetAccountResponse>
</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<GetAccountResponse> GetAccountAsync(
long accountId,
AccountAdditionalField? returnAdditionalFields)
{
var request = new GetAccountRequest
{
AccountId = accountId,
ReturnAdditionalFields = returnAdditionalFields
};
return (await CustomerManagementService.CallAsync((s, r) => s.GetAccountAsync(r), request));
}
static GetAccountResponse getAccount(
java.lang.Long accountId,
ArrayList<AccountAdditionalField> returnAdditionalFields) throws RemoteException, Exception
{
GetAccountRequest request = new GetAccountRequest();
request.setAccountId(accountId);
request.setReturnAdditionalFields(returnAdditionalFields);
return CustomerManagementService.getService().getAccount(request);
}
static function GetAccount(
$accountId,
$returnAdditionalFields)
{
$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];
$request = new GetAccountRequest();
$request->AccountId = $accountId;
$request->ReturnAdditionalFields = $returnAdditionalFields;
return $GLOBALS['CustomerManagementProxy']->GetService()->GetAccount($request);
}
response=customermanagement_service.GetAccount(
AccountId=AccountId,
ReturnAdditionalFields=ReturnAdditionalFields)
Requirements
Service: CustomerManagementService.svc v13
Namespace: https://bingads.microsoft.com/Customer/v13
Request Url
https://clientcenter.api.bingads.microsoft.com/CustomerManagement/v13/Account/Query
Request Elements
The GetAccountRequest 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 |
---|---|---|
AccountId | The identifier of the account to get. | long |
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 GetAccountResponse 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 |
---|---|---|
Account | An account object that contains information about the account, such as payment method, account type, and parent customer. | AdvertiserAccount |
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.
{
"AccountId": "LongValueHere",
"ReturnAdditionalFields": "ValueHere"
}
Response JSON
This template was generated by a tool to show the body and header elements for the JSON response.
{
"Account": {
"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<GetAccountResponse> GetAccountAsync(
long accountId,
AccountAdditionalField? returnAdditionalFields)
{
var request = new GetAccountRequest
{
AccountId = accountId,
ReturnAdditionalFields = returnAdditionalFields
};
return (await CustomerManagementService.CallAsync((s, r) => s.GetAccountAsync(r), request));
}
static GetAccountResponse getAccount(
java.lang.Long accountId,
ArrayList<AccountAdditionalField> returnAdditionalFields) throws RemoteException, Exception
{
GetAccountRequest request = new GetAccountRequest();
request.setAccountId(accountId);
request.setReturnAdditionalFields(returnAdditionalFields);
return CustomerManagementService.getService().getAccount(request);
}
static function GetAccount(
$accountId,
$returnAdditionalFields)
{
$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];
$request = new GetAccountRequest();
$request->AccountId = $accountId;
$request->ReturnAdditionalFields = $returnAdditionalFields;
return $GLOBALS['CustomerManagementProxy']->GetService()->GetAccount($request);
}
response=customermanagement_service.GetAccount(
AccountId=AccountId,
ReturnAdditionalFields=ReturnAdditionalFields)