获取添加一批关键字失败的确切关键字 [英] Getting the exact keyword(s) that fail for adding a batch of keywords

查看:81
本文介绍了获取添加一批关键字失败的确切关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


有没有办法在添加批量关键字时获得失败的确切关键字?


错误没有不给出确切的关键字,所以我们需要手动跟踪它。顺便说一句,我使用Java。


< BatchErrors>

    < BatchError>

      <代码> 1542< /代码>

      < Details i:nil =" true" />

      < ErrorCode> CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists< / ErrorCode>

      < Index> 0< / Index>

      <消息>已存在指定匹配类型的关键字。< / Message>

    < / BatchError>

    < BatchError>

      <代码> 1542< /代码>

      < Details i:nil =" true" />

      < ErrorCode> CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists< / ErrorCode>

      < Index> 1< / Index>

      <消息>已存在指定匹配类型的关键字。< / Message>

    < / BatchError>

    < BatchError> ...< BatchErrors>




谢谢

解决方案

Hello。


添加一批对象时,应用程序可以使用错误的Index属性来找到原始上载尝试中的重复关键字,将其删除,然后重试该操作。例如,如果你有一个关键字数组(例如keywords []),
那么批处理错误中返回的Index元素就是数组中duplicate关键字的相应索引。


<例如,这里是一个C#片段,您可以在Java中实现类似的东西。


catch(FaultException< EditorialApiFaultDetail> faultException)


{


    const int CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists = 1542;


    Console.WriteLine(""检测到重复的关键字:");


    foreach(faultException.Detail.BatchErrors.Where中的var错误(error => error.Code == CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists))


    {


  &NBSP; &NBSP;   Console.WriteLine(" [{0}] {1}",error.Index,keywords [error.Index] .Text);


   }


}


此博文包含更多提示和详细信息:


community.bingads.microsoft.com /.../一些小窍门 - 上 - 处理 - 复制 - 错误 - 当 - 上传 - 关键词通路的-bing-ads-api.aspx


我希望这会有所帮助!


Hi,

Is there a way to get the exact keywords that failed when adding a batch keyword?

The fault didn't give the exact keywords so we need to trace it manually. By the way Im using Java.

<BatchErrors>
    <BatchError>
      <Code>1542</Code>
      <Details i:nil="true"/>
      <ErrorCode>CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists</ErrorCode>
      <Index>0</Index>
      <Message>A keyword with the specified match type already exists.</Message>
    </BatchError>
    <BatchError>
      <Code>1542</Code>
      <Details i:nil="true"/>
      <ErrorCode>CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists</ErrorCode>
      <Index>1</Index>
      <Message>A keyword with the specified match type already exists.</Message>
    </BatchError>
    <BatchError>...<BatchErrors>

Thanks

解决方案

Hello.

When adding a batch of objects, an application can use the Index property of the error to locate the duplicate keyword from the original upload attempt, remove it and then retry the operation. For example if you have an array of Keywords (e.g. keywords[]), then the Index element returned in the batch error is the corresponding index of the duplicate keyword in your array.

For example here is a C# snippet, and you may implement something similar in Java.

catch (FaultException<EditorialApiFaultDetail> faultException)

{

   const int CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists = 1542;

   Console.WriteLine("Duplicate keywords detected: ");

   foreach (var error in faultException.Detail.BatchErrors.Where(error => error.Code == CampaignServiceKeywordAndMatchTypeCombinationAlreadyExists ))

   {

       Console.WriteLine("[{0}] {1}", error.Index, keywords[error.Index].Text);

   }

}

This blog post has more tips and details:

community.bingads.microsoft.com/.../some-tips-on-handling-duplicate-errors-when-uploading-keywords-via-the-bing-ads-api.aspx

I hope this helps!


这篇关于获取添加一批关键字失败的确切关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆