【问题标题】:Image is not created with Category creation using Bigcommerce API使用 Bigcommerce API 创建类别时未创建图像
【发布时间】:2018-04-10 05:59:12
【问题描述】:

我正在从事 Bigcommerce 项目以导入类别。但在 Bigcommerce 中,我们没有直接导入选项,因此我使用 Category API V3 在 Bigcommerce 上创建类别。 类别创建成功。已创建图片的 bigcommerce CDN URL,但图片未显示在 bigcommerce 网站上。

仅供参考 - 我正在使用 Bigcommerce API V3

请找到API调用和API结果。错位见谅。

Bigcommerce API Call

Result Information

请在下面找到代码。

$fields = array("parent_id" => "27","name" => "category3","description" => "test description","image_url" => "https://imageurl/yhst-130038008324021_2510_1762695707");

$fields = json_encode($fields);

$api_url = 'https://api.bigcommerce.com/stores/storehash/v3/catalog/categories';

$ch = curl_init(); 
curl_setopt( $ch, CURLOPT_URL, $api_url );
curl_setopt($ch, CURLOPT_TIMEOUT, 100); 
curl_setopt( $ch, CURLOPT_HTTPHEADER, array ('X-Auth-Client: client id','X-Auth-Token: auth token','Accept: application/json', 'Content-Type: application/json') );        
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST'); 
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 ); 
curl_setopt( $ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt( $ch, CURLOPT_USERPWD, "username:password" ); 
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );   
$response = curl_exec($ch);   
$result = json_decode($response); 

【问题讨论】:

  • 请在您的问题中添加实际代码,而不是代码截图,因为人们可能想复制您的代码并自己尝试
  • 您好,谢谢您的回复。我已经更新了我的代码

标签: bigcommerce


【解决方案1】:

这实际上是我们这边的一个问题。我们已经提出了内部工程票来解决它,我们希望尽快推出修复程序。当修复推出时,我会在这里更新您。

【讨论】:

  • 嗨,Karen White,感谢您的回复。现在问题解决了吗?
  • @PriyaDinesh 修复尚未部署,但我一定会在有更新时通知您。
  • 嗨,Karen,Bigcommerce 中的问题是否已解决?我需要在 Bigcommerce 中部署我们的网站。请指教。
  • 嗨@PriyaDinesh,修复程序已开始部署,但需要一点时间才能到达所有商店。你应该在一两天内开始看到这个工作。
  • @WillardSolutions 看起来 > 1MB 的图像文件在通过表单发布上传时会导致 500 错误。我将创建一张票来解决它。 {"image_url":"https://myimage.jpg"} 也应该可以工作,不管文档怎么说——我们将更新参考以显示“image_url”也是一个有效的上传选项。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-19
  • 1970-01-01
  • 1970-01-01
  • 2013-01-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多