How to retrieve shogun page metafields data using admin API

cory_stampr
Shopify Partner
2 0 0

I see that Shogun injects something along the lines of this liquid into my theme:

{% if page and page.metafields.shogun.head %}
{{page.metafields.shogun.head}}
{% endif %}

And it results in stylesheets being included in the rendered result, which leads me to believe there is in fact metafield data that exists somewhere.

But calling the metafield API returns no results when calling this: GET /admin/api/2021-01/metafields.json

{"metafields":[]}

I've also tried looking up the specific resource using the following, but they both return 404:

https://key:password@example.myshopify.com/admin/api/2021-01/admin/pages/12345678/metafields.json
https://key:password@example.myshopify.com/admin/api/2021-01/metafields.json?metafield%5Bowner_resource%5D=page&metafield%5Bowner_id%5D=12345678

So why is it saying no metafield data exists when I know for a fact it does (because it is included in rendered html) and how do I get access to that metafield data?

 

0 Likes