Issue submitting authorization code

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.

Have you seen further down that page as there is a list of error messages that tell you the issue.
https://dev.wix.com/api/getting-started#errors

409 - Conflict
The resource you are attempting to create already exists

thank you for the guidance! Much appreciated.

I am also facing the same issue? how to fix it please help.

Hi Kailash, To get support, please create a new post with a detailed description of your problem, including your code and any helpful screenshots. Here are our post guidelines . Thank you.