Export (0) Print
Expand All

AddBusinesses REST Template

Adds one or more businesses.

/customer/business

Request Components

The following specifies the HTTP method, supported content types, and base URI to use in your request.

  • HTTP method: POST

  • Supported content types: XML and JSON

    To use JSON, the following apply:

    • Your request URL must include the “format=json” query string.

    • For enumeration types, you must use numeric values instead of the value names defined in the value set. For example, to specify the Visa value defined in the PaymentType value set, set the Payment array element of the Business object to 5 instead of to Visa.

    • All enumerations are zero-based, and increment by 1.

    • The key names that you use for the JSON members are the same as the elements of the XML objects shown in the examples below.

  • Production base URI: https://adcenterapi.microsoft.com/Api/Advertiser/v8/CampaignManagement/CampaignManagementServiceREST.svc

  • Sandbox base URI: Not available.

Request Headers

The following are the headers to include in your request.

Header

Description

ApplicationToken

The application access token. This header is not used.

CustomerAccountId

The account identifier. For more information, see Account and Customer Identifiers.

CustomerId

The customer identifier. For more information, see Account and Customer Identifiers.

DeveloperToken

The developer access token.

Password

The user’s logon password.

UserName

The user’s logon user name.

Request Body

The following XML fragment shows the elements to use to add details of one or more businesses. For a description of each element and the header elements that your request must include, see AddBusinessesRequest Message Object.

<AddBusinessesRequest xmlns="http://schemas.datacontract.org/2004/07/HostedService.CampaignManagementService.Rest" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> 
  <Businesses xmlns:d2p1="https://adcenter.microsoft.com/v8" >
    <d2p1:Business>
      <d2p1:AddressLine1></d2p1:AddressLine1>
      <d2p1:AddressLine2></d2p1:AddressLine2>
      <d2p1:BusinessImageIcon>
        <d2p1:CustomIconAssetId></d2p1:CustomIconAssetId>
        <d2p1:StandardBusinessIcon></d2p1:StandardBusinessIcon>
      </d2p1:BusinessImageIcon>
      <d2p1:City></d2p1:City>
      <d2p1:CountryOrRegion></d2p1:CountryOrRegion>
      <d2p1:Description></d2p1:Description>
      <d2p1:Email></d2p1:Email>
      <d2p1:GeoCodeStatus i:nil="true" />
      <d2p1:HrsOfOperation>
        <d2p1:Day></d2p1:Day>
        <d2p1:openTime1>
          <d2p1:Begin>
            <d2p1:Hour></d2p1:Hour>
            <d2p1:Minute></d2p1:Minute>
          </d2p1:Begin>
          <d2p1:End>
            <d2p1:Hour></d2p1:Hour>
            <d2p1:Minute></d2p1:Minute>
          </d2p1:End>
        </d2p1:openTime1>
        <d2p1:openTime2>
          <d2p1:Begin>
            <d2p1:Hour></d2p1:Hour>
            <d2p1:Minute></d2p1:Minute>
          </d2p1:Begin>
          <d2p1:End>
            <d2p1:Hour></d2p1:Hour>
            <d2p1:Minute></d2p1:Minute>
          </d2p1:End>
        </d2p1:openTime2>
      </d2p1:HrsOfOperation>
      <d2p1:Id i:nil="true" />
      <d2p1:IsOpen24Hours></d2p1:IsOpen24Hours>
      <d2p1:LatitudeDegrees i:nil="true" />
      <d2p1:LongitudeDegrees i:nil="true" />
      <d2p1:Name></d2p1:Name>
      <d2p1:OtherPaymentDesc></d2p1:OtherPaymentDesc>
      <d2p1:Payment></d2p1:Payment>
        <d2p1:PaymentType></d2p1:PaymentType>
      <d2p1:Phone></d2p1:Phone>
      <d2p1:StateOrProvince></d2p1:StateOrProvince>
      <d2p1:Status i:nil="true" />
      <d2p1:Url></d2p1:Url>
      <d2p1:ZipOrPostalCode></d2p1:ZipOrPostalCode>
    </Business>
  </Businesses>
</AddBusinessesRequest>

Response Body

The following XML fragment shows the elements that are included in the response. For a description of each element and the TrackingId header element that the response includes, see AddBusinessesResponse Message Object.

<AddBusinessesResponse xmlns="http://schemas.datacontract.org/2004/07/Microsoft.AdCenter.Advertiser.CampaignManagement.Api.DataContracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <BusinessIds xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <a:long></a:long>
  </BusinessIds>
</AddBusinessesResponse>

Faults

If an error occurs, the service returns one of the following HTTP error codes.

Code

Description

400

Bad request, which indicates that the request data contains an error. The response will contain either an ApiFaultDetail or AdApiFaultDetail object that identifies the error. For a list of possible error codes, see Campaign Management Error Codes and Common Error Codes.

401

Not authorized.

404

Not found.

405

Method not allowed, which indicates that the URI template is not correct.

500

Server error.

Community Additions

Show:
© 2014 Microsoft