PHP DeleteKeywordsRequest || [代码] => 1528 [ErrorCode] => CampaignServiceKeywordDoesNotBelongToAdGroupId [英] PHP DeleteKeywordsRequest || [Code] => 1528 [ErrorCode] => CampaignServiceKeywordDoesNotBelongToAdGroupId
问题描述
我在使用Bing Ads API从广告组和广告组删除关键字时出现问题:DeleteKeywords服务运营
I am having an issue with deleting a Keyword from and AdGroup using the Bing Ads API: DeleteKeywords Service Operation
这是我的代码PHP:
Here is my code written in PHP:
grv_remove_bing_keyword(2447647796,15644864799);
function grv_remove_bing_keyword( $adgroup_id, $keyword_id ) {
$keyword = new Keyword();
$keyword->Status = 'Delete';
$keyword->Id = $keyword_id;
$request = new DeleteKeywordsRequest();
$request->AdGroupId = $adgroup_id;
$request->KeywordIds = array($keyword);
$result = $GLOBALS['proxy']->GetService()->DeleteKeywords( $request);
}
我做过一些测试:
以下是输出:GetKeywordsByAdGroupId用于验证我在调用时使用了正确的广告组和关键字ID的服务操作: DeleteKeywords服务运营
Below is the output of:GetKeywordsByAdGroupId Service Operation used to verify I was using the correct AdGroup and Keyword Ids in my call to: DeleteKeywords Service Operation
BingAds\CampaignManagement\GetKeywordsByAdGroupIdRequest Object
(
[AdGroupId] => 2447647796
)
The Result:
stdClass Object
(
[Keywords] => stdClass Object
(
[Keyword] => Array
(
[0] => stdClass Object
(
[Bid] => stdClass Object
(
[Amount] => 0.55
)
[DestinationUrl] =>
[EditorialStatus] => Active
[ForwardCompatibilityMap] => stdClass Object
(
)
[Id] => 15644676444
[MatchType] => Broad
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Active
[Text] => Fast Car
)
[1] => stdClass Object
(
[Bid] => stdClass Object
(
[Amount] => 0.55
)
[DestinationUrl] =>
[EditorialStatus] => Active
[ForwardCompatibilityMap] => stdClass Object
(
)
[Id] => 15644864423
[MatchType] => Broad
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Paused
[Text] => Faster Car
)
[2] => stdClass Object
(
[Bid] => stdClass Object
(
[Amount] => 0.55
)
[DestinationUrl] =>
[EditorialStatus] => Active
[ForwardCompatibilityMap] => stdClass Object
(
)
[Id] => 15644864799
[MatchType] => Broad
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Paused
[Text] => Faster mo betta Car
)
)
)
)
请求: 尝试删除广告组中的关键字:2447647796与KwId:15644864799
The Request: Trying to delete the keyword within AdGroup:2447647796 with KwId:15644864799
BingAds\CampaignManagement\DeleteKeywordsRequest Object
(
[AdGroupId] => 2447647796
[KeywordIds] => Array
(
[0] => BingAds\CampaignManagement\Keyword Object
(
[Bid] =>
[DestinationUrl] =>
[EditorialStatus] =>
[ForwardCompatibilityMap] =>
[Id] => 15644864799
[MatchType] =>
[Param1] =>
[Param2] =>
[Param3] =>
[Status] => Delete
[Text] =>
)
)
)
The Result:
stdClass Object
(
[PartialErrors] => stdClass Object
(
[BatchError] => Array
(
[0] => stdClass Object
(
[Code] => 1528
[Details] =>
[ErrorCode] => CampaignServiceKeywordDoesNotBelongToAdGroupId
[Index] => 0
[Message] => Keyword specified does not belong to the AdGroup.
[Type] => BatchError
)
)
)
)
推荐答案
你好,
看来你在请求中传递了整个关键字对象 - in在这种情况下,调用期望一组关键字ID。请尝试仅传递此处记录的ID数组:
https://msdn.microsoft.com/en-us/library/dn236318.aspx 。
如果您之后仍然无法成功运行呼叫,请以XML格式提供完整的SOAP请求和响应,因为这样我们就可以了查看实际从您的终端发送到我们服务器的内容。
Hello,
It seems that you're passing the entire keyword object in your request -- in this case, the call is expecting an array of keyword ID's. Please try passing only the array of ID's as documented here: https://msdn.microsoft.com/en-us/library/dn236318.aspx .
If you're still unable to successfully run the call afterward, please provide your full SOAP request and response in XML format, as that will allow us to see what is actually being sent from your end to our servers.
谢谢,
Matt
这篇关于PHP DeleteKeywordsRequest || [代码] => 1528 [ErrorCode] => CampaignServiceKeywordDoesNotBelongToAdGroupId的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!