skip to Main Content

Currently, we are registering new products and updating existing products via the Shopify API. However, all of a sudden, we can no longer register new products and the following error is occurring.

pyactiveresource.connection.ResourceNotFound: Not Found: https://[shop-ulr].myshopify.com/admin/api/2023-01/images.json

I am using Python to call ShopifyAPI.
How can I solve this problem?

In order to identify this problem, we checked the code one by one. It seems that the error occurs when the following code is executed.

image.save()

image = shopify.Image()
image.product_id = product_id
image.src=img['src']
image.alt = img['alt']

...

image.save()   #Error occurred here

2

Answers


  1. Chosen as BEST ANSWER

    Ohh, the cause was actually quite simple. Indeed, the error occurred with image.save(), but when I checked the image, it didn't contain any elements.

    Furthermore, tracing back the cause, it seems that product.save() was not done correctly, and it was because there was no product that the image couldn't be set.


  2. The "ResourceNotFound" error in the context of the Shopify API typically occurs when you attempt to save an image to a location that doesn’t exist or is invalid. To resolve this issue, you can follow these steps:

    Verify the image URL or file path: Ensure that the image you are trying to save exists and is accessible. Double-check the URL or file path to ensure it is correct.

    Confirm the destination directory: Check the destination directory where you are trying to save the image. Make sure the directory exists and is writable. You might need to create the directory if it doesn’t exist.

    Use the correct file name and extension: Ensure that you are providing a valid file name with the correct extension. The file name should include the file type extension (e.g., ".jpg", ".png").

    Check for special characters: Avoid using special characters or spaces in the file name or path, as they can cause issues. Stick to alphanumeric characters and underscores if possible.

    Debug the code: If the error persists, review your code and make sure you are using the appropriate method to save the image. Look for any potential mistakes or missing steps.

    If you are still encountering the "ResourceNotFound" error after following these steps, it might be helpful to provide more specific information about your code and the exact error message you are receiving.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search