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

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 The Bing Ads managed user's sign-in password. string
UserName The Bing Ads managed user's sign-in name. You must not set this element to a Microsoft account or email address. string

Important

The UserName and Password header elements are deprecated. In future versions of the API, Bing Ads will transition exclusively to Microsoft Account (email address) authentication. For more information, see Authentication with OAuth. UserName and Password are still required for Bing Ads managed credentials, but they are not applicable for Microsoft account authentication. To authenticate a Microsoft account, use the AuthenticationToken] header instead of UserName and Password.

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

The following template shows the order of the body and header elements for the SOAP request.

<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/v11">
    <Action mustUnderstand="1">GetCustomer</Action>
    <ApplicationToken i:nil="false">ValueHere</ApplicationToken>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
    <Password i:nil="false">ValueHere</Password>
    <UserName i:nil="false">ValueHere</UserName>
  </s:Header>
  <s:Body>
    <GetCustomerRequest xmlns="https://bingads.microsoft.com/Customer/v11">
      <CustomerId>ValueHere</CustomerId>
    </GetCustomerRequest>
  </s:Body>
</s:Envelope>

Response SOAP

The following template shows 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/v11">
    <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/v11">
      <Customer xmlns:e11="https://bingads.microsoft.com/Customer/v11/Entities" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <e11:CustomerAddress d4p1:nil="false">
          <e11:City d4p1:nil="false">ValueHere</e11:City>
          <e11:CountryCode d4p1:nil="false">ValueHere</e11:CountryCode>
          <e11:Id d4p1:nil="false">ValueHere</e11:Id>
          <e11:Line1 d4p1:nil="false">ValueHere</e11:Line1>
          <e11:Line2 d4p1:nil="false">ValueHere</e11:Line2>
          <e11:Line3 d4p1:nil="false">ValueHere</e11:Line3>
          <e11:Line4 d4p1:nil="false">ValueHere</e11:Line4>
          <e11:PostalCode d4p1:nil="false">ValueHere</e11:PostalCode>
          <e11:StateOrProvince d4p1:nil="false">ValueHere</e11:StateOrProvince>
          <e11:TimeStamp d4p1:nil="false">ValueHere</e11:TimeStamp>
        </e11:CustomerAddress>
        <e11:CustomerFinancialStatus d4p1:nil="false">ValueHere</e11:CustomerFinancialStatus>
        <e11:Id d4p1:nil="false">ValueHere</e11:Id>
        <e11:Industry d4p1:nil="false">ValueHere</e11:Industry>
        <e11:LastModifiedByUserId d4p1:nil="false">ValueHere</e11:LastModifiedByUserId>
        <e11:LastModifiedTime d4p1:nil="false">ValueHere</e11:LastModifiedTime>
        <e11:MarketCountry d4p1:nil="false">ValueHere</e11:MarketCountry>
        <ForwardCompatibilityMap xmlns:e12="http://schemas.datacontract.org/2004/07/System.Collections.Generic" d4p1:nil="false">
          <e12:KeyValuePairOfstringstring>
            <e12:key d4p1:nil="false">ValueHere</e12:key>
            <e12:value d4p1:nil="false">ValueHere</e12:value>
          </e12:KeyValuePairOfstringstring>
        </ForwardCompatibilityMap>
        <e11:MarketLanguage d4p1:nil="false">ValueHere</e11:MarketLanguage>
        <e11:Name d4p1:nil="false">ValueHere</e11:Name>
        <e11:ServiceLevel d4p1:nil="false">ValueHere</e11:ServiceLevel>
        <e11:CustomerLifeCycleStatus d4p1:nil="false">ValueHere</e11:CustomerLifeCycleStatus>
        <e11:TimeStamp d4p1:nil="false">ValueHere</e11:TimeStamp>
        <e11:Number d4p1:nil="false">ValueHere</e11:Number>
      </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)
{
    var request = new GetCustomerRequest
    {
        CustomerId = customerId
    };

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

    request.setCustomerId(customerId);

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

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

    $request = new GetCustomerRequest();

    $request->CustomerId = $customerId;

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

Requirements

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