Have your say in Community Polls: What was/is your greatest motivation to start your own business?

theme-app-extension: Make an external api call to get data to access in liquid files

theme-app-extension: Make an external api call to get data to access in liquid files

abhay-singh
Visitor
1 0 0

Hi there,

 

I want some data from an external server through an API call.

How do I make an API call to get data which I can access inside liquid files of theme app extension

Replies 6 (6)

JustinW
Shopify Partner
15 0 4

You will want to use the Shopify App Proxy architecture to do this. You can see more info in the links below:
https://shopify.dev/apps/online-store/app-proxies
https://www.youtube.com/watch?v=ZiugtHDctFk

Helping customers integrate their E-Commerce and Salesforce data
aidendev
Shopify Partner
51 1 0

Is creating a proxy app the only way to make external api calls from one's theme extension? 

JustinW
Shopify Partner
15 0 4

It depends on what you are trying to do. Either proxy app or Shopify functions are the ways of modifying backend data in Shopify.

Helping customers integrate their E-Commerce and Salesforce data
aidendev
Shopify Partner
51 1 0

I see, so safe to say any api calls to external services require proxy app. ty

aidendev
Shopify Partner
51 1 0

hey can anyone let me know what the protocol is to make post requests to external apis? i have been able to do GET requests no problem but im getting Bad Request (400) errors when trying to send data to my external backend. 

aidendev
Shopify Partner
51 1 0

proxy app POST requests dont seem to work anymore.. is there a new approach? if you can lmk much appreciated