Created
November 27, 2014 14:51
-
-
Save fditrapani/244913ca61eabfe89a8c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Set variables for our request | |
| $shop = "demo-shop"; | |
| $request_headers = array( | |
| "Content-type" => "application/json", // Tell Shopify that we're expecting a response in JSON format | |
| "client_id" => "1r30mrvCFMfq2DLGuIXyY2veEJVgTtDD", // Your app API key | |
| "client_secret" => "TBB5wltKarRtKn5mUVZck9RxHePNN6Jo", // Your app credentials (secret key) | |
| "code" => $_GET["code"] // Grab the access key from the URL | |
| ); | |
| // Call our Shopify function | |
| $shopify_response = shopify_call(NULL, $shop, "/admin/oauth/access_token", $request_headers, 'POST', $request_headers); | |
| // Convert response into a nice and simple array | |
| $shopify_response = json_decode($shopify_response['response'], TRUE); | |
| // Store the response | |
| $token = $shopify_response['access_token']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment