Since yesterday I try to juste get a list of my products via Shopify Javascript API.
1. Shopify Javascript API
I tried to follow this tutorial: https://shopify.github.io/js-buy-sdk/
My code:
const shopClient = ShopifyBuy.buildClient({
apiKey: 'e1616e793836bd1178d34dfa124667cf',
appId: '6',
domain: 'cordillot-store.myshopify.com'
})
// fetch a product using resource id
shopClient.fetchAllProducts()
.then(function (product) {
console.log(product)
})
.catch(function () {
console.log('Request failed')
})
2. Private App instructions
So, I decided to follow the instruction after creating my private app
My code:
import request from 'superagent'
request
.get('https://e1616e793836bd1178d34dfa124667cf:[email protected]/admin/products.json')
.end((error, response) => {
console.log(error)
console.log(response)
})
And I got a 401:
But, this URL works well with cURL
curl -X GET https://e1616e793836bd1178d34dfa124667cf:[email protected]/admin/products.json
3. Public App
After I created a Public Application and try to connect with Oauth (https://help.shopify.com/api/guides/authentication/oauth).
Everything runs good until I tried to reach the URL 'http://[SHOP_NAME]/admin/oauth/access_token', I got an 404.
Anyone can help me?
Thank you a lot!