doufei2328 2015-04-09 04:35
浏览 56
已采纳

Bigcommerce API产品图片

I am able to upload products to my Bigcommerce store via the API with no problem, but I want to link those products to images that I have already uploaded via WebDav-the images are currently in the 'upload' folder. How do I do this?

When I upload products via a CSV file, all I do is have a column labeled 'Product Image File', which contains the file name of the image that is residing in the 'upload' folder. When products are created this way, Bigcommerce will automagically link the products with the associated images.

End goal is to use the API for product creation, and tell Bigcommerce which image file to use that has been uploaded via WebDav, in advance.

  • 写回答

2条回答 默认 最新

  • dragon321723 2015-04-09 23:08
    关注

    The main thing to note in regards to adding images via API is that it must be done in a separate request from the creation of the product, unlike when importing by CSV. Your script should first create the product and capture the ID of the newly created product from the response BC gives you. Once you have that ID you can add an image by following the "create a product image" POST method described on this page:

    https://developer.bigcommerce.com/api/stores/v2/products/images

    You can only add one image per POST request.

    The full path to the image (including http://) will be added to the image_file parameter of the object you pass in your POST request body. This is the only parameter that must be passed when creating an image but there are other things you can pass along as well if you choose.

    If the images that you have uploaded to the Webdav server of your store are placed into the /product_images/import/ folder then you can reference the image in the image_file parameter by just the name of the image with it's extension (ie: image_name.jpg) just like in a CSV import. You stated that you uploaded your images to an 'upload' folder though, if that is the case you must use the full HTTP path to the image.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示