Development discussions around Shopify APIs
Is there any way I could get compiled html through API? I have generated json data in html and I would like to fetch that on outside server, and because CORS I'm unable to do that so I'm looking for a backup solution.
Solved! Go to the solution
This is an accepted solution.
Install an App in the store. When you setup the configuration of that App, you can add an App Proxy. Your App will listen for calls to an endpoint your App services. Shopify will then securely call your App to that endpoint, and you can return HTML to the store, where Shopify will render it into the DOM and the customer will see your HTML. You can add Liquid tags to the HTML on your server, and Shopify will also fill in the Liquid, making this a very powerful pattern when used.
The reason you have CORS problems is because you cannot call external websites from Shopify.
This is an accepted solution.
Install an App in the store. When you setup the configuration of that App, you can add an App Proxy. Your App will listen for calls to an endpoint your App services. Shopify will then securely call your App to that endpoint, and you can return HTML to the store, where Shopify will render it into the DOM and the customer will see your HTML. You can add Liquid tags to the HTML on your server, and Shopify will also fill in the Liquid, making this a very powerful pattern when used.
The reason you have CORS problems is because you cannot call external websites from Shopify.
User | RANK |
---|---|
6 | |
5 | |
5 | |
5 | |
4 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022