Code $_GET Params This post is outdated
I have a request.
But the answer is:
400 - Oauth error invalid_request / Oauth error invalid_request: The authorization code was not found or was already used
I didnt found, how can I generate $ _GET ['code'] I think when I create $_GET['code'], it will run straight. I think problem is $_GET['code']
My code is this:
$ client_id = 'xx'; $ client_secret = 'xxx'; $url = "https://" . $shop . "/admin/oauth/access_token"; $ post_data = array ('client_id' => $ client_id, 'client_secret' => $ client_secret, 'code' => $ _GET ['code']); $ post_json = json_encode ($ post_data); $ curl = curl_init (); curl_setopt_array ($ curl, array ( CURLOPT_URL => $ url, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $ post_json, CURLOPT_HTTPHEADER => array ( "cache-control: no-cache", "content-type: application / json" ) ));