A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Trying to retrieve a count of new orders via API calls today and received a 404 error. Further investigation showed that all API calls were generating the same error. The strange thing is that the same routines work fine when I run them from my home.
This is the resulting header data when trying to retrieve a count of new orders:
HTTP/1.1 404 Not Found
Date: Mon, 12 Dec 2022 17:36:38 GMT
Content-Type: application/json; charset=utf-8
Connection: close
X-Sorting-Hat-PodId: 86
X-Sorting-Hat-ShopId: 11848064
Vary: Accept-Encoding
Referrer-Policy: origin-when-cross-origin
X-Frame-Options: DENY
X-ShopId: 11848064
X-ShardId: 86
X-Stats-UserId:
X-Stats-ApiClientId: 1304342
X-Stats-ApiPermissionId: 18905386
X-Shopify-API-Terms: By accessing or using the Shopify API you agree to the Shopify API License and Terms of Use at https://www.shopify.com/legal/api-terms
X-Shopify-API-Version: 2022-01
X-Shopify-API-Version-Warning: https://shopify.dev/concepts/about-apis/versioning
HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/80
X-Shopify-Shop-Api-Call-Limit: 1/80
Strict-Transport-Security: max-age=7889238
X-Shopify-Stage: production
Content-Security-Policy: default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=error_404&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Ferrors&source%5Bsection%5D=admin_api&source%5Buuid%5D=8e6784ae-8d93-45c3-816b-a5ce718663cd
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block; report=/xss-report?source%5Baction%5D=error_404&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Ferrors&source%5Bsection%5D=admin_api&source%5Buuid%5D=8e6784ae-8d93-45c3-816b-a5ce718663cd
X-Dc: gcp-us-east5,gcp-us-central1,gcp-us-central1
X-Request-ID: 8e6784ae-8d93-45c3-816b-a5ce718663cd
CF-Cache-Status: DYNAMIC
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=wKPBoWA0WWuHTDhY4hMsr7Yexc%2BnKU6Km%2FO%2FH7GBXMZe5FzijyJp6Q8%2FK01FddTXdsuqR0CWJTYV%2FjcMpp4slsTmNR9rO1TQ3DebKLIENPiaKakDz0t917%2Fvu2GiYaUEFW5HfFqk%2BjFyfV0cEe5SSzoG"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}
Server-Timing: cfRequestDuration;dur=738.000154
Server: cloudflare
CF-RAY: 7788393108a2e230-ORD
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
I have no idea why requests from the customer site error out, and the same requests from my home work.
This had been working fine for years. No changes have been made.
Any help with this would be greatly appreciated.
Solved! Go to the solution
This is an accepted solution.
Hey @Ron_K,
Thanks for sharing these response details so we could take a closer look. Using the x-request-id and date headers, we were able to locate logs for the request that returned errors and other similar errors returned to the same app.
The endpoint used appeared to have a missing version, GET /admin/api//orders/count.json?since_id={SINCE_ID} , and using this we found several other requests to this endpoint that also returned errors. When replicating from our test client this endpoint returned similar 404 errors, however once a version is added to the endpoint, eg. /admin/api/2022-10/orders... , the request returns data as expected.
There were also logs from successful request made after the error was returned, these URLs included the version. Hope you have or will able to use this info to get this resolved from your end moving forward.
Best!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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
This is an accepted solution.
Hey @Ron_K,
Thanks for sharing these response details so we could take a closer look. Using the x-request-id and date headers, we were able to locate logs for the request that returned errors and other similar errors returned to the same app.
The endpoint used appeared to have a missing version, GET /admin/api//orders/count.json?since_id={SINCE_ID} , and using this we found several other requests to this endpoint that also returned errors. When replicating from our test client this endpoint returned similar 404 errors, however once a version is added to the endpoint, eg. /admin/api/2022-10/orders... , the request returns data as expected.
There were also logs from successful request made after the error was returned, these URLs included the version. Hope you have or will able to use this info to get this resolved from your end moving forward.
Best!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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
Thanks for the quick response. I was updating the API Version # and I thought I would use a global variable for the version. Unfortunately the variable was blank, causing the problem.