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 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号