Load Product Images - API

Highlighted
Tourist
4 0 1

Hello!

I created a script to add a new product through the API.
Everything is working. But there is a problem with the images.
All my images have a port number of ":8081" in the link.
Example:
SITE.com:8081/image_1.jpg

These images are not loaded via the API.
Images not having ":8081" - work.

Shopify probably blocks such links.

Is there any way to allow stores to work with such links?

Thanks you!

0 Likes
Highlighted
Shopify Expert
4131 29 384

Can you make your question clearer? What do you mean "Is there anyway to allow stores to work with such links?"

You want Shopify to serve up your images. So upload them to the products in question. You have many choices that way. When you say images not having a port desigation work, what does that mean? Work how?

 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Tourist
4 0 1

Thanks for the answer.
I'm sorry that the explanation is not detailed enough.

I need to create a product and upload images using the API. My script is working correctly.

If the link to the image looks like "SITE.com/image_1.jpg" - everything works - the product is created and has an image.
It works as it should.

But, if the link to the image looks like "SITE.com:8081/image_1.jpg" - the product is created, but there is no image.

If I try to add images through the admin panel, I get an error:

image.png


I think the problem is in the link - ":8081"

I cannot change the link because all the images are stored on the client server.

Does Shopify have any restrictions on working with image links? Is there any way to change this?
Or maybe there is another reason for the error?

Thanks! 

0 Likes
Highlighted
Shopify Expert
4131 29 384

Shopify has an upload media option that may work for you. The script I would write would do the following.

  • for a product with an image stored with a port declaration
  • download that image to your hard drive
  • upload the image to Shopify's image service at Amazon S3, where a signed URL awaits
  • upload the signed URL image to the product

With that, you can have all the images, and not worry about the ones with the port declaration being missed.

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes