Good day,
I’ve followed the authentication steps from the following URL https://dev.wix.com/api/getting-started#authentication
I’m having an issue with step 4. I’m submitting a cURL from PHP with the specified header and relevant data that is stipulated in the Batch code example (Oauth > Access Token Request).
Please see my code below:
$curl_post_vars = array(
"grant_type" => "authorization_code",
"client_id" => "XXX",
"client_secret" => "XXX",
"code" => "OAUTH2.XXX"
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.wix.com/oauth/access");
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt(
$curl,
CURLOPT_HTTPHEADER,
array(
"Content-Type: application/json",
)
);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($curl_post_vars));
var_dump(curl_exec($curl))
curl_close($curl);
The output I get is:
{"errorCode":409,"errorDescription":"Internal Server Error [request-id: 1570717739.03120484110121131734]","success":false,"payload":null}
I apologise if this isn’t the correct forum to post this problem but I could not find a forum for dev.wix.com.