GetCustomer Service Operation - Customer Management

Gets the details of a customer.

Request Elements

The GetCustomerRequest 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.

Request Body Elements

Element Description Data Type
CustomerId The identifier of the customer whose information you want to get. long
IncludeCustomerAddress Determines whether or not to return the Address element in the returned Customer object.

If this element is set True then the address will be returned, and otherwise it will not be included in the response (not even a nil Address element).
boolean

Request Header Elements

Element Description Data Type
AuthenticationToken The OAuth access token that represents a Microsoft Account user who has permissions to Bing Ads 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 GetCustomerResponse 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
Customer A Customer object that contains information about the customer. Customer

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">GetCustomer</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <GetCustomerRequest xmlns="https://bingads.microsoft.com/Customer/v12">
      <CustomerId>ValueHere</CustomerId>
      <IncludeCustomerAddress>ValueHere</IncludeCustomerAddress>
    </GetCustomerRequest>
  </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>
    <GetCustomerResponse xmlns="https://bingads.microsoft.com/Customer/v12">
      <Customer xmlns:e256="https://bingads.microsoft.com/Customer/v12/Entities" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <e256:CustomerFinancialStatus d4p1:nil="false">ValueHere</e256:CustomerFinancialStatus>
        <e256:Id d4p1:nil="false">ValueHere</e256:Id>
        <e256:Industry d4p1:nil="false">ValueHere</e256:Industry>
        <e256:LastModifiedByUserId d4p1:nil="false">ValueHere</e256:LastModifiedByUserId>
        <e256:LastModifiedTime d4p1:nil="false">ValueHere</e256:LastModifiedTime>
        <e256:MarketCountry d4p1:nil="false">ValueHere</e256:MarketCountry>
        <e256:ForwardCompatibilityMap xmlns:e257="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
          <e257:KeyValuePairOfstringstring>
            <e257:key d4p1:nil="false">ValueHere</e257:key>
            <e257:value d4p1:nil="false">ValueHere</e257:value>
          </e257:KeyValuePairOfstringstring>
        </e256:ForwardCompatibilityMap>
        <e256:MarketLanguage d4p1:nil="false">ValueHere</e256:MarketLanguage>
        <e256:Name d4p1:nil="false">ValueHere</e256:Name>
        <e256:ServiceLevel d4p1:nil="false">ValueHere</e256:ServiceLevel>
        <e256:CustomerLifeCycleStatus d4p1:nil="false">ValueHere</e256:CustomerLifeCycleStatus>
        <e256:TimeStamp d4p1:nil="false">ValueHere</e256:TimeStamp>
        <e256:Number d4p1:nil="false">ValueHere</e256:Number>
        <e256:CustomerAddress d4p1:nil="false">
          <e256:City d4p1:nil="false">ValueHere</e256:City>
          <e256:CountryCode d4p1:nil="false">ValueHere</e256:CountryCode>
          <e256:Id d4p1:nil="false">ValueHere</e256:Id>
          <e256:Line1 d4p1:nil="false">ValueHere</e256:Line1>
          <e256:Line2 d4p1:nil="false">ValueHere</e256:Line2>
          <e256:Line3 d4p1:nil="false">ValueHere</e256:Line3>
          <e256:Line4 d4p1:nil="false">ValueHere</e256:Line4>
          <e256:PostalCode d4p1:nil="false">ValueHere</e256:PostalCode>
          <e256:StateOrProvince d4p1:nil="false">ValueHere</e256:StateOrProvince>
          <e256:TimeStamp d4p1:nil="false">ValueHere</e256:TimeStamp>
          <e256:BusinessName d4p1:nil="false">ValueHere</e256:BusinessName>
        </e256:CustomerAddress>
      </Customer>
    </GetCustomerResponse>
  </s:Body>
</s:Envelope>

Code Syntax

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

public async Task<GetCustomerResponse> GetCustomerAsync(
	long customerId,
	bool includeCustomerAddress)
{
	var request = new GetCustomerRequest
	{
		CustomerId = customerId,
		IncludeCustomerAddress = includeCustomerAddress
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.GetCustomerAsync(r), request));
}
static GetCustomerResponse getCustomer(
	java.lang.Long customerId,
	boolean includeCustomerAddress) throws RemoteException, Exception
{
	GetCustomerRequest request = new GetCustomerRequest();

	request.setCustomerId(customerId);
	request.setIncludeCustomerAddress(includeCustomerAddress);

	return CustomerManagementService.getService().getCustomer(request);
}
static function GetCustomer(
	$customerId,
	$includeCustomerAddress)
{

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

	$request = new GetCustomerRequest();

	$request->CustomerId = $customerId;
	$request->IncludeCustomerAddress = $includeCustomerAddress;

	return $GLOBALS['CustomerManagementProxy']->GetService()->GetCustomer($request);
}
response=customermanagement_service.GetCustomer(
	CustomerId=CustomerId,
	IncludeCustomerAddress=IncludeCustomerAddress)

Requirements

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