Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello, I am trying to send a request to Rest API ( no need to GraphQL )... my request is to get products from the API.
you can see what I've done in the image attached.
This request works only if I am authenticated as the store's admin, it doesn't work in a private browser or when you're not authenticated.
I have looked for this issue in Google, and I found that because the access token wasn't added, but I did and I can see it as a request's header in Chrome's DevTools
Solved! Go to the solution
This is an accepted solution.
I just found out randomly that products can be retrieved by this way:
https://{store}.myshopify.com/products.json
Don't know why I couldn't find this solution while searching for it.
any idea?
The title of the topic is about the storefront API, but you're not using the storefront API.
Now if you're using the Rest ADMIN api via the browser I'm ok with this not working.
This would expose the key and password to anyone looking at the source so is a pretty scary security issue.
What's the reason why are you doing things this way?
All I need is to get products list as search results ( for anyone, even unauthenticated visitors )
I have tried using the API without '/admin' but doesn't work
any solution please?
I'm trying to get products with API and this is what I got from my search...
is ther any other API endpoint for that?
This is an accepted solution.
I just found out randomly that products can be retrieved by this way:
https://{store}.myshopify.com/products.json
Don't know why I couldn't find this solution while searching for it.