Issue with admin api

cmartt
New Member
4 0 0

Hello there,

 

I am trying to use Shopify admin API. I successfully created a custom app and also allowed all the necessary admin scopes but still got the error - not found (404) with the API. 

 

Api I am using - 

https://{storename}.myshopify.com/admin/api/2023-10/products.json

and also added an access token in X-Shopify-Access-Token inside header.

 

All the api's returned same 404 not found error. So can you let me know the issue.

 

Replies 6 (6)

Liam
Shopify Staff
2731 302 777

Hi Cmartt,

The 404 error usually means that the requested resource couldn't be found on the server. This could be due to several reasons, here are a few things to check:

  1. Store Name: Verify that the store name in the URL is correct. Remember, it is case sensitive.

  2. Access Token: Ensure that the access token you are using is valid and has the necessary scopes to access the resources you are trying to reach.

Try the above and let us know if you're still running into issues,

Liam | Developer Advocate @ 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

cmartt
New Member
4 0 0

Hi Liam,

 

I checked all the scopes in the admin configuration and also verified the store name to be exactly same. But still get the same error - not found (404).

 

curl i am using in postman- 

curl -d '{"product":{"title":"Burton Custom Freestyle 151","body_html":"<strong>Good snowboard!</strong>","vendor":"Burton","product_type":"Snowboard","status":"draft"}}' \
-X POST "https://cmartt.myshopify.com/admin/api/2023-10/products.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

 

Is there any other process or thing where we have to register to use admin rest api. Then let me know i will try with that.Screenshot 2023-11-01 at 11.56.13 AM.pngScreenshot 2023-11-01 at 11.56.06 AM.png

Liam
Shopify Staff
2731 302 777

Do you still see the same error if you try on a terminal/ console outside of Postman?

Liam | Developer Advocate @ 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

cmartt
New Member
4 0 0

yes showing the same error.

Screenshot 2023-11-01 at 2.01.37 PM.png

Liam
Shopify Staff
2731 302 777

Hi Cmartt,

 

The structure of your API call looks to be correct - are you certain you have the `products` access scope enabled? 

 

Liam | Developer Advocate @ 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

cmartt
New Member
4 0 0

Yes, I allowed all the scopes of admin API configuration.