Hi, I have unlisted Shopify app and I have setup App Proxy with prefix as “a” and subpath as “customer-meta”. I have supplied the full URL of the php file under Proxy URL. I use laravel-shopify for my unlisted app.
On the Shopify’s liquid theme, I have an ajax call (GET) to the app proxy.
$.ajax({
method: "GET",
crossDomain: true,
url: "/a/customer-meta",
data: $("#custmeta").serialize()
})
.done(function( response, textStatus, jqXHR ) {
$( "#updatebutton" ).prop("disabled", false);
$( "#updatebutton" ).html("SAVE / EDIT CHILD");
if(response == 'success'){
$( "#dialog-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
location.reload();
}
}
});
} else {
$( "#dialog-error-message" ).dialog({
modal: true,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
}
})
.fail(function( jqXHR, textStatus, errorThrown ) {
$( "#updatebutton" ).prop("disabled", false);
$( "#updatebutton" ).html("SAVE / EDIT CHILD");
var errorMessage = jqXHR.status + ': ' + jqXHR.statusText + '\n';
errorMessage += 'Please check your data and try again. If this error continues, please contact us for assistance.';
alert('Error - ' + errorMessage);
});
I’m unable to replicate the 401 error message however a lot of my customers are saying they’re getting 401 error message ($.ajax.fail condition). I checked my website statistic and there is 63% rate of 401. I’m using offline access token so the token itself shouldn’t expire so I’m not sure why some users are getting 401 error and some not.
Any help will be really appreciated. Thanks!