我从去年开始使用谷歌购物 Api,它工作正常。但现在我想在其中添加新属性,例如CustomLabel5
. 为此,我使用setCustomAttributes()
了方法并传递了三个属性name
, type
, value
。
但它正在显示错误 400 无效属性值。以下是我的代码,请检查并建议正确的答案。
$product = new Google_Service_ShoppingContent_Product();
$data= new Google_Service_ShoppingContent_ProductCustomAttribute();
$data->setName('CustomLabel5');
$data->setType('text');
$data->setValue('test');
$product->setCustomAttributes($data);
请给出答案。