A space to discuss online store customization, theme development, and Liquid templating.
I know the pattern when I set up an App Proxy. For example, for my Shopify store https://jigglezoggle.myshopify.com I can have /apps/flooblefart as an endpoint, and Shopify will send my GET or POST to my App when I do an AJAX call to /app/flooblefart with (or without) data. I get back JSON or Liquid, my choice.
So let us say my DNS is mapping that *.myshopify.com name to https://www.excellentnews.com. If I make my JS calls to https://www.excellentnews.com/apps/flooblefart is that equivalent and acceptable practice?
I am seeing exactly that in a client shop, and it confuses me, and the FQDN is not something I ever considered using. Do most App Proxy calls use FQDN? If yes, why?
Solved! Go to the solution
This is an accepted solution.
Actually, correction. I forgot to add my custom (real) domain name to the development store. Once I did that everything worked fine. The app proxy passed along things okay!
For grins I just tried this now for a test. And I received a middleman error from Cloudflare. Assuming on Shopify's side, since my app proxy receiver doesn't utilize this service.
This is an accepted solution.
Actually, correction. I forgot to add my custom (real) domain name to the development store. Once I did that everything worked fine. The app proxy passed along things okay!
So strange but I accept that there are now two ways to work it. Thanks for confirming that!
Hi,
I am getting the same issue, I had fixed the 403 one but a new error occurred " refused to connect." so can you please help me fixing this.
thanks in advance
So after revisiting old shopify proxy applications for a little over a year, there seems to have been an update when it comes to making POST requests to App Proxies. I've been getting the same 400 Bad Request errors specifically for POST requests only when trying to perform ajax calls to hit my app's backend methods:
$.ajax({
type: 'POST',
url: '/apps/member-area',
headers: {
'X-Shopify-Access-Token': accessToken,
'RequestVerificationToken': antiForgeryToken,
'Content-Type': 'application/json'
},
data: JSON.stringify(formData),
dataType: 'json',
beforeSend: function (jqXHR, settings) {
console.log('Request URL:', settings.url);
console.log('Request Type:', settings.type);
console.log('Request Headers:', jqXHR.getAllResponseHeaders());
console.log('Request Data:', settings.data);
},
xhr: function () {
var xhr = new window.XMLHttpRequest();
xhr.addEventListener('readystatechange', function () {
if (xhr.readyState === 4) { // DONE
console.log('Response Headers:', xhr.getAllResponseHeaders());
console.log('Request Data:', xhr);
}
});
return xhr;
},
success: function (response) {
if (response.success) {
$('#UserFeedbackMessage').text(response.message).css('color', 'green').show();
} else {
$('#UserFeedbackMessage').text(response.message).css('color', 'red').show();
}
},
error: function (xhr, status, error) {
console.error("Error updating collector info:", error);
console.log("XHR:", xhr);
console.log("Status:", status);
console.log("Response Text:", xhr.responseText);
$('#UserFeedbackMessage').text("An error occurred while updating your profile.").css('color', 'red').show();
}
});
Have you guys experienced this problem as well?