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" ) ));
As I understand it's:
1. Call "oauth/authorize?client_id=API_KEY&redirect_uri=REDIRECT_URL&scope=SCOPES
2. The redirect url should then get the $_GET['code']
3. Call "oauth/access_token" as in your code.
Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...By Gabe Jan 6, 2023
How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...By Skye Dec 30, 2022