Can't call the https://api.sandbox.paypal.com/v1/oauth2/token - PayPal Connect

managepavans
Contributor
Contributor

Hi,

 

I am also facing the same issue with getting access token at PayPal connect process. See code below:

Request Code:

$curl = curl_init();

$base_token
= "{client_id: secret}";

$data = array(
CURLOPT_URL => "https://api.sandbox.paypal.com/v1/oauth2/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array(
'grant_type' => 'authorization_code',
'code' => '{CODE}'
),
CURLOPT_HTTPHEADER => array(
"Authorization: Basic ".$base_token,
),
);
curl_setopt_array($curl,$data );
$response = curl_exec($curl);
curl_close($curl);

Response Code:

stdClass Object
(
    [name] => Bad Request
    [debug_id] => 2858088aa4473
    [message] => java.lang.IllegalArgumentException
    [details] => Array
        (
        )
)

Thanks in advance

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.