负关键字列表记录 - 批量

定义可在批量文件中下载和上传的负关键字 (keyword) 列表。

可以通过在 DownloadCampaignsByAccountIds 或 DownloadCampaignsByCampaignIds 服务请求中包含 NegativeKeywordListsDownloadEntity 值来下载帐户中的所有 Negative KeywordList 记录。 此外,下载请求必须包括 EntityData 范围。 有关批量服务的更多详细信息(包括最佳做法),请参阅 批量下载和上传

以下批量 CSV 示例将添加新的负关键字 (keyword) 列表。

Type,Status,Id,Parent Id,Campaign,Ad Group,Client Id,Modified Time,Keyword,Match Type,Name
Format Version,,,,,,,,,,6.0
Negative Keyword List,Active,-19,,,,ClientIdGoesHere,,,,My Negative Keyword List

如果使用用于 .NET、Java 或 Python 的必应广告 SDK ,则可以使用 BulkServiceManager 来节省时间来上传和下载 BulkNegativeKeywordList 对象,而无需直接调用服务操作和编写自定义代码来分析批量文件中的每个字段。

var uploadEntities = new List<BulkEntity>();

// Map properties in the Bulk file to the BulkNegativeKeywordList
var bulkNegativeKeywordList = new BulkNegativeKeywordList
{
    // 'Client Id' column header in the Bulk file
    ClientId = "ClientIdGoesHere",

    // Map properties in the Bulk file to the 
    // NegativeKeywordList object of the Campaign Management service.
    NegativeKeywordList = new NegativeKeywordList
    {
        // 'Id' column header in the Bulk file
        Id = negativeKeywordListIdKey,
        // 'Name' column header in the Bulk file
        Name = "My Negative Keyword List",
    },

    // 'Status' column header in the Bulk file
    Status = Status.Active
};

uploadEntities.Add(bulkNegativeKeywordList);

var entityUploadParameters = new EntityUploadParameters
{
    Entities = uploadEntities,
    ResponseMode = ResponseMode.ErrorsAndResults,
    ResultFileDirectory = FileDirectory,
    ResultFileName = DownloadFileName,
    OverwriteResultFile = true,
};

var uploadResultEntities = (await BulkServiceManager.UploadEntitiesAsync(entityUploadParameters)).ToList();

对于 否定关键字列表 记录, 批量文件架构中提供了以下属性字段。

客户端 ID

用于将批量上传文件中的记录与结果文件中的记录相关联。 服务器不使用或存储此字段的值;它只是从上传的记录复制到相应的结果记录。 它可以是长度最大为 100 的任何有效字符串。

添加:
更新:
删除: 只读

Id

负关键字 (keyword) 列表的系统生成的标识符。

添加: 选。 必须将此字段留空,或指定负标识符。 然后,可以在相关记录类型的 Id 字段中引用为负关键字 (keyword) 列表设置的负标识符,例如市场活动负面关键字列表关联。 如果要添加新的负面关键字 (keyword) 列表并将其与同一批量文件中的市场活动相关联,则建议这样做。 有关详细信息,请参阅 批量文件架构引用密钥
更新: 只读和必需
删除: 只读和必需

修改时间

上次更新实体的日期和时间。 该值以协调世界时 (UTC) 表示。

注意

日期和时间值反映服务器的日期和时间,而不是客户端。 有关日期和时间格式的信息,请参阅 基元 XML 数据类型中的 dateTime 条目。

添加: 只读
更新: 只读
删除: 只读

名称

负关键字 (keyword) 列表的名称。

名称的最大长度为 255。

添加: 必填
更新: 必填
删除: 只读

状态

负关键字 (keyword) 列表的状态。

可能的值为 ActiveDeleted

添加: 选。 默认值为 Active
更新: 只读
删除: 必填。 “状态”必须设置为 “已删除”。