Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DownloadCampaignsByCampaignIds Service Operation

Downloads the specified campaigns’ data. You can request all campaign data or only the data that has changed since the last time you downloaded the campaign.

Request | Response

Example Code | Error Codes

Service: BulkService.svc v8 | Namespace: https://adcenter.microsoft.com/v8

DownloadCampaignsByCampaignIdsRequest Message

Request Elements

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

Element

Description

Data Type

Required

AdditionalEntities

The additional entities to include in the download. By default, campaign and ad group data does not include entities such as targets and negative keywords. For a list of additional entities that you can download, see the AdditionalEntity value set.

AdditionalEntity

No

Campaigns

The campaigns to download. You can specify a maximum of 1,000 campaigns. The campaigns that you specify must belong to the same account.

CampaignScope[]

Yes

DownloadFileType

The format of the download file. For possible values, see DownloadFileType. The default is XML.

DownloadFileType

No

LastSyncTimeInUTC

The last time that you requested a download. The date and time is expressed in Coordinated Universal Time (UTC).

Typically, you request a full download the first time you call the operation by setting this element to null. On all subsequent calls you set the last sync time to the time stamp of the previous download.

The download file contains the time stamp of the download in the SyncTime element of the Customers object. Use the time stamp to set LastSyncTimeInUTC the next time that you request a download. For information about the format of the date and time, see the dateTime entry in Primitive XML Data Types.

If you specify the last sync time, only those entities that have changed (been updated or deleted) since the specified date and time will be downloaded. However, if the campaign data has not been previously downloaded, the operation performs a full download.

After requesting a full download, the only time that you should again request a full download would be if your account was included in a data migration (for example, the URL by match type migration). If you specify a last sync time that predates the end of the migration process, the download will fail with FullSyncRequeired (error code 3603).

dateTime

No

LocationTargetVersion

The version of the location codes to return if the target contains location targets. You should set this element if you set AdditionalEntities to CampaignTargets or AdGroupTargets.

The following are the possible values. If null, the default is the oldest supported version.

  • Latest – Use the latest supported version

  • 1 – Metro- codes

  • 2 – Nielsen DMA® codes

If the target specifies metro codes and you set version to 2 (or Latest), the service maps the metro codes to DMA® codes and returns them. If the target specifies DMA® codes and you set version to 1, the service maps the DMA® codes to metro codes and returns them.

Because older versions may not be supported in the future, consider setting this element to Latest to avoid breaking changes.

string

No

Request Headers

For information about the values you set the DeveloperToken, Password, and UserName elements to, see Getting Started With the Bing Ads API.

Element

Description

Data Type

ApplicationToken

The application-access token. This header element is not used and should be null.

string

AuthenticationToken

The authentication token. This header element is not used and should be null.

string

CustomerAccountId

The identifier of the account that owns the entities in the request.

string

CustomerId

The identifier of the customer that owns the account. This header element is not used and should be null.

string

DeveloperToken

The caller's developer-access token.

string

Password

The user's sign-in password.

string

UserName

The user's sign-in user name. You cannot set this element to a Microsoft account (formerly known as Windows Live ID).

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://adcenter.microsoft.com/v8">
    <Action mustUnderstand="1">DownloadCampaignsByCampaignIds</Action>
    <ApplicationToken i:nil="false"></ApplicationToken>
    <CustomerAccountId i:nil="false"></CustomerAccountId>
    <CustomerId i:nil="false"></CustomerId>
    <DeveloperToken i:nil="false"></DeveloperToken>
    <Password i:nil="false"></Password>
    <UserName i:nil="false"></UserName>
  </s:Header>
  <s:Body>
    <DownloadCampaignsByCampaignIdsRequest xmlns="https://adcenter.microsoft.com/v8">
      <AdditionalEntities i:nil="false"></AdditionalEntities>
      <Campaigns i:nil="false">
        <CampaignScope>
          <CampaignId></CampaignId>
          <ParentAccountId></ParentAccountId>
        </CampaignScope>
      </Campaigns>
      <DownloadFileType i:nil="false"></DownloadFileType>
      <LastSyncTimeInUTC i:nil="false"></LastSyncTimeInUTC>
      <LocationTargetVersion i:nil="false"></LocationTargetVersion>
    </DownloadCampaignsByCampaignIdsRequest>
  </s:Body>
</s:Envelope>

DownloadCampaignsByCampaignIdsResponse Message

Response Elements

Element

Description

Data Type

DownloadRequestId

The identifier of the download request. You use the identifier to call the GetDownloadStatus operation to check the status of the download. The identifier is valid for a maximum of five days.

string

Response Headers

Element

Description

Data Type

TrackingId

The identifier of the log entry that contains the details of the API call.

string

Response SOAP

The following example shows the complete SOAP response envelope.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://adcenter.microsoft.com/v8">
    <TrackingId p4:nil="false" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"></TrackingId>
  </s:Header>
  <s:Body>
    <DownloadCampaignsByCampaignIdsResponse xmlns="https://adcenter.microsoft.com/v8">
      <DownloadRequestId p4:nil="false" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance"></DownloadRequestId>
    </DownloadCampaignsByCampaignIdsResponse>
  </s:Body>
</s:Envelope>

Example Code

For an example that shows how to call this operation to download the entities of one or more campaigns, see C# | Java | PHP.

Error Codes

If the service operation fails, it throws a FaultException exception, which contains one or more of the Bing Ads API error data objects. For information about the fault detail objects, see Bulk Error Data Objects and Handling Service Errors and Exceptions.

The following are the possible error codes and messages that the fault objects can include. The list does not include common, operation-related error codes shared by the services (for example, UserIsNotAuthorized or InvalidCredentials). For a list common error codes, Common Error Codes.

Error code

Symbolic

Description

1113

CampaignServiceCampaignsArrayShouldNotBeNullOrEmpty

The list of campaigns cannot be null or empty.

1114

CampaignServiceCampaignsArrayExceedsLimit

The list of campaigns exceeds the maximum number allowed.

3203

CampaignServiceCampaignsContainsMultipleAccounts

The list of campaigns must belong to the same account.

3204

CampaignServiceCampaignsContainsNullScope

The list of campaigns cannot contain null items.

3208

CampaignServiceLastSyncTimeCannotBeInTheFuture

The last sync time cannot be later than now.

3500

CampaignServiceBulkApiNotEnabledForPilot

The customer is not a member of the bulk download pilot program.

3603

CampaignServiceFullSyncRequired

The last sync time must be null.

You must set the last sync time to null if the specified account was included in a data migration (for example, the URL by match type migration). After requesting a full download, you can begin requesting delta downloads again.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.