rest api Product Image endpoint (position problem)

hooijer
New Member
4 0 0

I got an api script and the script need to delete all the pictures and reupload new pictures (pictures only)

Everything works except “The video”

 

I figured out that I cant edit the video whit rest api (so video is manually added)
now my script sends post data

“{ "position": "1", "src": "https://www.hooijergroep.nl/fotos/CT36M.800/CT36M.800_1.png", "alt": "Ascend Crew II Heren Wandelsokken Klasse 1 Grey" }”

 

And the script adds the picture

But the video stays on position 1

 

I know that I can rearrange the image once they are uploaded
but that’s 2 more api calls per product (1 get and 1 put)

 

Is thare a way to make the position work or always set video last position
so I don’t need 2 more api calls

0 Likes
Jayvin
Shopify Partner
219 34 57

Hi,

Just make the 2 calls.

0 Likes
Jason27
Shopify Partner
78 1 25

I've had this same issue with videos. Since the rest product API doesn't return videos, the position will move around when you upload new photos. This imo is a bug with Shopify API. There needs to be a way to return the video and be able to manipulate the position along with the image positions.

0 Likes
hooijer
New Member
4 0 0

it is a solution but it is very slow

 

0 Likes
Jason27
Shopify Partner
78 1 25

Making 2 calls is not 'very' slow. It's inconvenient.

However, there is no solution if you are unaware there are any videos. You can solve it because you know there's a video already on the tests you are running, but since the Rest API does not disclose any videos, there is no way of managing video positions vs image positions for all the installed shops once your app is live and in the app store.

0 Likes
hooijer
New Member
4 0 0

it seems that i cant fix it whit api

even if i use 2 more calls it still does not work we will think of another solution whitout api

0 Likes