I have a Problem with OAuth RestApi.
when I send the request via OAuth Restapi, I get this error.
here you can find my request and response.
my code always worked, so now i don't know where this error is, can you please help me
Request
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.ebay.com/identity/v1/oauth2/token',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "grant_type=authorization_code&code=*****&redirect_uri=https%3A%2F%2Fsamurai-team%2FEbayGetTokenOauth.php",
CURLOPT_COOKIE => "ebay=%255Esbf%253D%2523%255E; dp1=bu1p%2FQEBfX0BAX19AQA**63f5eac0%5E",
CURLOPT_HTTPHEADER => [
"Authorization : Basic ******",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Response:
Array
(
[error] => invalid_request
[error_description] => request is missing a required parameter or malformed.
)