Hi,
I’m trying to download the data of some client metafields using “Make.com”. But I’m having problems with a “file type” metafield.
I’m receiving just a Global ID URL. How is it posible to “translate” the “Global ID URL” to a “normal URL” that I can use on any browser or Make.com?
These are the only 2 URLs I’m receiving from the metafield:
Thank you very much
Hey There!
The answer would depend on where you’re reading the data from.
If you’re reading the data in the liquid API you would need to retrieve the references from the metafield value.
{% if metafield.type == "file_reference" %}
{{ metafield.value.src }}
{% endif %}
If you’re reading from the admin api you can request the reference value.
query Product{
product(id: "gid://shopify/Product/7989949431830"){
metafield(namespace: "custom", key: "image"){
id
reference{
...on MediaImage{
image {
url
}
}
}
}
}
}
Hi Tyler,
The file is a client metafield type “file”. What should be the Query in this case?
Thanks
The queries above should do the trick.
Hi Tyle,
I’m using the Shopify REST API. Which should be the endpoint URL using Shopify REST API?
Thank you
hi!
With your help and a lot of tries, I’ve found the solution:
query {
metafield(id: "gid://shopify/Metafield/28466662342965") {
reference{
...on MediaImage{
image {
url
}
}
}
}
}
Thank you