I have built an embedded Shopify app (in Rails) using the shopify_app gem. To be able to make API calls to the Shopify store front, I need to exchange a URL parameter “code” for an authentication token. My understanding is, that this parameter should be available in the URL after the app has been installed – however this is not the case for me.
Please, how can I get the “code” parameter? so that I can authenticate my app and send API calls.
Thank you
2
Answers
The shopify_app library does the initial authentication of the app and after instalation automatically converts the 'code' parameter into the appropriate token, which is to be used to authenticate your API calls. The token is stored in the Db under shop:shopify_token. Make sure to specify 'create_scripttags' in your application scope.
I think the
code
parameter you are looking for is found in Step 3 of OAuth process with Shopify as described here https://help.shopify.com/en/api/getting-started/authentication/oauth#step-3-confirm-installation