bigcommerce-api-python icon indicating copy to clipboard operation
bigcommerce-api-python copied to clipboard

ProductVideos cannot create, delete, or delete_all

Open joegarcia opened this issue 6 years ago • 2 comments

From the documentation in the following URL, you would think you can create, delete, and delete_all videos for a product:

https://developer.bigcommerce.com/legacy/v2-catalog-products/v2-product-videos

newer documentation:

https://developer.bigcommerce.com/api-reference/catalog/catalog-api/product-videos/

Expected behavior

I expected that you would be able to something like this and it create a video: video = api.ProductVideos.create(parentid=product_id, url=video_url)

Actual behavior

If I try to create a video I get the following error: AttributeError: type object 'ProductVideos' has no attribute 'create'

Steps to reproduce behavior

product_id = "id of product" video_url = "some youtube video url" video = api.ProductVideos.create(parentid=product_id, url=video_url)

joegarcia avatar Jan 22 '19 00:01 joegarcia

Thanks for raising the issue @joegarcia ! It looks like the video resource is missing the create and delete methods, even though those methods are allowed:

https://github.com/bigcommerce/bigcommerce-api-python/blob/8ba3ad860ffcd8c03dabf5bea52155b9dd0e0111/bigcommerce/resources/products.py#L135

Opened #78 to update methods.

karen-white avatar Jan 24 '19 17:01 karen-white

Hi @joegarcia , the change has merged and should be included if you pull down the latest version of the library. Would you mind testing and closing out this issue if that fixed the problem? Thanks!

karen-white avatar Jan 30 '19 23:01 karen-white