I use https://github.com/nozzlegear/ShopifySharp .Net library to work with Shopify Api. I just create dev webshop and I want to test some GET methods. In documentation I saw next code:
string code = Request.QueryString["code"];
string myShopifyUrl = Request.QueryString["shop"];
string accessToken = await AuthorizationService.Authorize(code, myShopifyUrl, shopifyApiKey, shopifySecretKey);
All parameters I understand except first , what code is this , where I should get it?? Thanks
2
Answers
You should create a method in your controller which will receive a callback from Shopify:
Then when you building authorization URL, you should set variable
redirectUrl
to the method above:And once user will be redirected to authorization URL, it will open Shopify page where user will be able to install app. Then Shopify will redirect him to your callback method with
code
andshop
parametersThis is basically Authorization code
It is with respect to concept of “OAuth”
Refer:
https://help.shopify.com/api/getting-started/authentication/oauth