GET /admin/products.json?collection_id=841564295
$.getJSON("/admin/products.json?collection_id=841564295", function(productData) {
console.log(productData);
});
using this code i’m getting all the products in a collection by collection id….
only if i’m logged in as admin..
if i’m not loggedin there is no response but “Status Code:303 See Other” error..
3
Answers
Got all the products by collection....
The 303 is a redirect (to the login page).
Use the
/products
endpoint instead:$.getJSON("/products.json?collection_id=841564295", function(productData) {
console.log(productData);
});
You can do like this:
I am getting namespace of product using this api, you can get whatever you want in products.