DownloadCampaignsByCampaignIds Service Operation - Bulk

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

You must use the same user credentials for the download request operation (either DownloadCampaignsByAccountIds or DownloadCampaignsByCampaignIds) and the GetBulkDownloadStatus polling operation.


The Bulk File Schema provides details about records that you can download and upload. Please adhere to the best practices to ensure fair usage for yourself and all Bing Ads clients. For details please see Bulk Download Best Practices and Bulk Upload Best Practices.

Request Elements

The DownloadCampaignsByCampaignIdsRequest 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
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 array
CompressionType The compression type of the download file. For possible values, see CompressionType. The default is Zip. CompressionType
DataScope You may include quality score data such as ad relevance, in addition to entity data such as campaign settings. The default value is EntityData.

You may include multiple values as flags. How you specify multiple flags depends on the programming language that you use. For example, C# treats these values as flag values and Java treats them as an array of strings. The SOAP should include a string that contains a space-delimited list of values for example, <DataScope>EntityData QualityScoreData</DataScope>.

If BidSuggestionsData or QualityScoreData are included, you must request a full sync. To perform a full sync, set LastSyncTimeInUTC to NULL.
DownloadEntities The entities to include in the download. For a list of entities that you can download, see the DownloadEntity value set.

You must specify at least one download entity, and otherwise the operation will error.
DownloadEntity array
DownloadFileType The format of the download file. For possible values, see DownloadFileType. The default is CSV. DownloadFileType
FormatVersion The format for records of the download file.

As a best practice you should always specify the latest format version. Currently the only supported format version for Bing Ads API Version 12 is 6.0.

You should manage records according to the Bulk File Schema for the corresponding format version.
LastSyncTimeInUTC The last time that you requested a download. The date and time is expressed in Coordinated Universal Time (UTC).

If you specify the last sync time, only those entities that have changed (added, updated, or deleted) since the specified date and time will be downloaded. You cannot specify a date and time older than 90 days, as otherwise an error will be returned.

Target criterion are treated slightly different from other entities, and deleted records are not returned. If any changes were made to a campaign or ad group's target, then all currently active sub target criterion records are returned.

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 column of the Account record. Use the time stamp to set LastSyncTimeInUTC the next time that you request a 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 sitelink version 2 migration). If you specify a last sync time that predates the end of the migration process, the download will fail with CampaignServiceFullSyncRequired (error code 3603).
PerformanceStatsDateRange This element is not supported in Bing Ads API Version 12, and will be removed in a future version. If you want data aggregated by day, week, or month, you can use the Bing Ads Reporting API. For more details see Reports. PerformanceStatsDateRange

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
CustomerAccountId The identifier of the account that owns the entities in the request. This header element must have the same value as the AccountId body element when both are required. string
CustomerId The identifier of the customer that contains and owns the account. If you manage an account of another customer, you should use that customer ID instead of your own customer ID. 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


The CustomerAccountId and CustomerId are required for most service operations, and as a best practice you should always specify them in the request.

Response Elements

The DownloadCampaignsByCampaignIdsResponse 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
DownloadRequestId The identifier of the download request. You use the identifier to call the GetBulkDownloadStatus operation to check the status of the download. The identifier is valid for a maximum of two days. If you have not successfully downloaded the file within this period, it is removed from the download site and you will need to get a new download request identifier.

The string has a length up to 40 and can contain any character.

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="" xmlns:s="">
  <s:Header xmlns="">
    <Action mustUnderstand="1">DownloadCampaignsByCampaignIds</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <CustomerAccountId i:nil="false">ValueHere</CustomerAccountId>
    <CustomerId i:nil="false">ValueHere</CustomerId>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
    <DownloadCampaignsByCampaignIdsRequest xmlns="">
      <Campaigns i:nil="false">
      <CompressionType i:nil="false">ValueHere</CompressionType>
      <DownloadEntities i:nil="false">
      <DownloadFileType i:nil="false">ValueHere</DownloadFileType>
      <FormatVersion i:nil="false">ValueHere</FormatVersion>
      <LastSyncTimeInUTC i:nil="false">ValueHere</LastSyncTimeInUTC>
      <PerformanceStatsDateRange i:nil="false">
        <CustomDateRangeEnd i:nil="false">
        <CustomDateRangeStart i:nil="false">
        <PredefinedTime i:nil="false">ValueHere</PredefinedTime>

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="">
  <s:Header xmlns="">
    <TrackingId d3p1:nil="false" xmlns:d3p1="">ValueHere</TrackingId>
    <DownloadCampaignsByCampaignIdsResponse xmlns="">
      <DownloadRequestId d4p1:nil="false" xmlns:d4p1="">ValueHere</DownloadRequestId>

Code Syntax

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

public async Task<DownloadCampaignsByCampaignIdsResponse> DownloadCampaignsByCampaignIdsAsync(
	IList<CampaignScope> campaigns,
	CompressionType? compressionType,
	DataScope dataScope,
	IList<DownloadEntity> downloadEntities,
	DownloadFileType? downloadFileType,
	string formatVersion,
	DateTime? lastSyncTimeInUTC,
	PerformanceStatsDateRange performanceStatsDateRange)
	var request = new DownloadCampaignsByCampaignIdsRequest
		Campaigns = campaigns,
		CompressionType = compressionType,
		DataScope = dataScope,
		DownloadEntities = downloadEntities,
		DownloadFileType = downloadFileType,
		FormatVersion = formatVersion,
		LastSyncTimeInUTC = lastSyncTimeInUTC,
		PerformanceStatsDateRange = performanceStatsDateRange

	return (await BulkService.CallAsync((s, r) => s.DownloadCampaignsByCampaignIdsAsync(r), request));
static DownloadCampaignsByCampaignIdsResponse downloadCampaignsByCampaignIds(
	ArrayOfCampaignScope campaigns,
	CompressionType compressionType,
	ArrayList<DataScope> dataScope,
	ArrayOfDownloadEntity downloadEntities,
	DownloadFileType downloadFileType,
	java.lang.String formatVersion,
	Calendar lastSyncTimeInUTC,
	PerformanceStatsDateRange performanceStatsDateRange) throws RemoteException, Exception
	DownloadCampaignsByCampaignIdsRequest request = new DownloadCampaignsByCampaignIdsRequest();


	return BulkService.getService().downloadCampaignsByCampaignIds(request);
static function DownloadCampaignsByCampaignIds(

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

	$request = new DownloadCampaignsByCampaignIdsRequest();

	$request->Campaigns = $campaigns;
	$request->CompressionType = $compressionType;
	$request->DataScope = $dataScope;
	$request->DownloadEntities = $downloadEntities;
	$request->DownloadFileType = $downloadFileType;
	$request->FormatVersion = $formatVersion;
	$request->LastSyncTimeInUTC = $lastSyncTimeInUTC;
	$request->PerformanceStatsDateRange = $performanceStatsDateRange;

	return $GLOBALS['BulkProxy']->GetService()->DownloadCampaignsByCampaignIds($request);


Service: BulkService.svc v12