2
votes

I am using a java raw HTTP client to connect to Shopify API (specifically, using Play Framework with the non-defualt sync driver which is actually the JDK's default driver).

My application usually manages to connect successfully and convert the temporary access token into a permanent one by calling the /admin/oauth/access_token endpoint.

However, sometimes I get this error result from the API:

Generic Error(400)
{"error":"invalid_request"}

I haven't been able to reproduce the issue with my test stores - I've tried installing a fresh store, reinstalling existing stores after uninstalling, I'm not sure why this call sometimes fail and how to debug it. The API call still continues to succeed for some stores using our application.

Some things that I am doing:

  1. Even if the URL of the store is on a custom domain, I'm always using the https://foo.myshopfiy.com/admin/oauth/access_token URL and not the URL of the custom domain, to prevent a redirect.
  2. I am always using an https URL and never an http one, again to prevent a redirect (we noticed a few issues with redirect with the Java HTTP client, so we aim to have zero redirects)
  3. A thread I found about this error suggest possible problems with our SSL certificates, however I don't think this is my problem because some requests work for us, and the result of running openssl on our machine does't show any issues.

How should I proceed? Open a support ticket with Shopify?

FYI, I see that this specific problem only started yesterday on Feb 19 2013, so it might be a temporary issue.

1
Can you please include: API key, shop names that are causing errors, HTTP requests/responses? The best place to go for Shopify API support is our APIs and Tech forums: ecommerce.shopify.com/c/shopify-apis-and-technology Were you directed to Stack Overflow from any of our documentation?Lydia Krupp-Hunter
@LydiaKrupp-Hunter - yeah, this post asks users to post to Stack Overflow - groups.google.com/forum/?fromgroups#!forum/shopify-app-discuss Could I submit the above details in a private message instead of a public forum post?ripper234
Message lydia [at] shopify.com.Lydia Krupp-Hunter
@LydiaKrupp-Hunter - thanks, emailed.ripper234

1 Answers

2
votes

FYI, the problem was caused by reusing a temporary access code.

Our fault - Shopify could have been more clear in their error message though.