Invalid Request for Initial Key Exchange

Adam_Harrison2
Explorer
127 0 19

Hi,

I'm having a problem with the initial key exchange for the public API between a shop and my app. I've been using this same code to perform key exchanges for over ~300 installs, successfully. For some reason, every so often, it fails without explanation, with a 400 {"error": "invalid_request"}.

This happened many times in rapid succession when I tried to install on the shop: eshopadmin.myshopify.com. The app's API key is: 58e67a172e42fae78b6f587e0dc8cad6.

Any ideas?

Replies 2 (2)
Adam_Harrison2
Explorer
127 0 19

The request should look like the following (roughly):

 

POST https://eshopadmin.myshopify.com/admin/oauth/access_token

Content-Type: application/x-www-form-urlencoded

 

client_id=58e67a172e42fae78b6f587e0dc8cad6&client_secret=***********&code=*******************

 

I also just did a succesful install, using the exact same piece of code, on another shop. It's very odd.

ajaysaini99
New Member
2 0 0

Hi, should these parameters be passed as 

const parms = {

          client_id : *********,

          code : *****,

         client_secret : ******

and if you could help me with the latest oAuth version, where should I make the post request to get permanent acces token.