1
votes

Can the App proxy be used to pass through various ID's for a separate backend rails app?

I have the case where we've implemented a subscription system in a separate rails app, but we want to show the user their subscriptions from Shopify. To do this I would like to add an app proxy on Shopify, such as:

Proxy Url: subscriptions.com/api/customers/subscriptions Proxy Path: /a/customers

But I'd like to be able to proxy /a/customers/:customer_id/subscriptions, maybe even /a/customers/:customer_id/subscriptions/:id (for a show subscription liquid response), so concatenating the ids into the url is my main goal.

On the rails side I can easily extract the path_prefix from the params, its a matter of how Shopify is matching the Proxy Paths I guess.

Is this at all possible? Or is there another way around this problem?

1

1 Answers

0
votes

The extra path components get appended to the Proxy URL. The Shopify Application Proxy documentation even provides an example showing this in the Proxy Request section.

So for you example, where the proxy url is http://subscriptions.com/api/customers/subscriptions and the proxy path is /a/customers then a request to /a/customers/:customer_id/subscriptions will be proxied to http://subscriptions.com/api/customers/subscriptions/:customer_id/subscriptions

So it sounds like the proxy request is already exactly what you want.