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

Solved
jordan-warner-8
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
vix
Shopify Staff
Shopify Staff
534 105 105

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? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes