Shopify / shopify-node-app

An example app that uses Polaris components and shopify-express
MIT License
328 stars 136 forks source link

Unable to retrieve contents of specific assets via asset API #138

Closed jfrankdev closed 5 years ago

jfrankdev commented 6 years ago

I am working on creating an app with this repo. Everything is working great in retrieving product data and some data about assets but I am having trouble with retrieving the contents of asset files.

For example, this call works perfectly in retrieving a complete list of theme assets as an object:

https://72926fc0.ngrok.io/shopify/api/themes/38307725370/assets.json

However if I wish to make a call to a specific asset and retrieve its contents (the actual html/js/liquid whatever in the file), according to these docs https://help.shopify.com/en/api/reference/online_store/asset, this call should do it:

https://72926fc0.ngrok.io/shopify/api/themes/38307725370/assets.json?asset[key]=templates/index.liquid

What's weird is this call just retrieves the same data as the first call which is just a big list of the assets in the theme as an object... but no specific asset contents.

calls like this /products/1977430802490.json inside the demo api console return a product object just fine.

Now I know we are using shopify-api-node for some things, but it doesn't seem to be involved after app init. That's why I was trying out these calls straight from the docs.

The call returns properly if you make a call like this without ngrok: https://mystore.myshopify.com/admin/themes/38307725370/assets.json?asset[key]=templates/index.liquid

Anyone experience anything similar? What am I missing?

nwtn commented 5 years ago

Closing because this project is now deprecated.