gpt4 book ai didi

php - PHP 中的 eBay API 调用返回 'The item specific Brand is missing' 错误

转载 作者:行者123 更新时间:2023-12-05 09:20:47 26 4
gpt4 key购买 nike

我与 ebay 的 API 集成开始出现以下错误消息:

[result] => 21919403: The item specific Brand is missing. Add Brand to this listing, enter a valid value, and then try again. )

我知道这与缺少 XML 标记有关。我什至尝试将标签添加到此 xml;它没有工作:

$requestXmlBody .= "<ItemSpecifics> ";
foreach ($ebayApi_itemspecifics as $ebayApi_itemspecifickey=>$ebayApi_itemspecificvalue) {
$requestXmlBody .= "<NameValueList><Name>" . str_replace('&', '&amp;', $ebayApi_itemspecifickey) . "</Name>
<Value>".$ebayApi_itemspecificvalue."</Value></NameValueList>";
}

$requestXmlBody .= " <NameValueList>
<Name>Brand</Name>
<Value>Navdari</Value>
</NameValueList>
</ItemSpecifics>";

最佳答案

这是有效的解决方案:

$this->item->ProductListingDetails = new Types\ProductListingDetailsType();
$this->item->ProductListingDetails->UPC = 'Does not apply';

$this->item->ItemSpecifics = new Types\NameValueListArrayType();

$specific = new Types\NameValueListType();
$specific->Name = 'Brand';
$specific->Value[] = 'BrandValue';
$this->item->ItemSpecifics->NameValueList[] = $specific;

$specific = new Types\NameValueListType();
$specific->Name = 'MPN';
$specific->Value[] = 'MPNValue';
$this->item->ItemSpecifics->NameValueList[] = $specific;

关于php - PHP 中的 eBay API 调用返回 'The item specific Brand is missing' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35992978/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com