d
Topic
mbeezy Member
Posts:
3
8 months ago

Product Image Metafields / Alt Text This post is outdated

Hi all

I'm having some trouble retrieving the following metafields from the product image object:

  1. Alt Text that's managed via the Product Image admin screen.  According to what I've read, they're stored as Metafields.
  2. Custom metafield that I added into the Metafields collection in the Image object

I've tried retrieving it using the "metafields" API, however, I'm unable to get anything back:  

metafields.json?metafield[owner_id]={ownerId}&metafield[ower_resource]={ownerResource}

I know that I successfully added the metafield because when I try to re-add it, I get an exception saying that I cannot use the same key in the metafield.

I also tried using the "products" API, but still no luck:

products/{productId}/images/{imageId}/metafields.json

Is there something that I'm doing wrong?  Is there another API call that I should be using?

Thanks,

Mike

i
Replies
mbeezy Member
Posts:
3
7 months ago

Hopefully this will help someone but the reason why it wasn't working for me was because I was using the wrong root element to parse the results.  Stupid...I know.  I was referencing "metafield" instead of "metafields".

By the way, I'm using a .NET Shopify API library called Shopify Sharp.  It can be found here:  https://github.com/nozzlegear/ShopifySharp.  I'm using that library for my API layer and Angular for my front-end.

Mike