Rest Api - console error ([Deprecation] Subresource requests whose URLs contain embedded credentials

Solved
Highlighted
Tourist
6 0 0

 

Hey,

 

I am trying to use the rest api to simply get a collection, I want to display the products on a non-shopify website using the image, title, price, product link

so users can click and go to product page of the store for each item. 

 

I have created an app in the backend of shopify, and am using the query as below:

 

https://{apikey}:{password}@{hostname}/admin/api/{version}/{collectionid}/products.json

 

I'm making a js call like below:

 

$.ajax({
url: url,
jsonp: 'callback',
dataType: 'jsonp',
success: function(bit_json) {
//
console.log(bit_json);
}
});

0 Likes
Highlighted
Shopify Staff
Shopify Staff
503 98 91

This is an accepted solution.

You should not use the Admin API client side as this exposes your secret credentials. You will want to use the Storefront API 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes