this works in console but when i try in PHP doesn't work
$cURL = "curl -X POST -d 'client_id=".$CLIENT_ID."&client_secret=".$CLIENT_SECRET."&grant_type=authorization_code&code=".$CODE."' https://www.wrike.com/oauth2/token";
CODE PHP.
$postData = array("client_id" => $CLIENT_ID,
"client_secret" => $CLIENT_SECRET,
"grant_type" => "authorization_code",
"code" => $CODE);
$handler = curl_init();
curl_setopt($handler, CURLOPT_URL, $url);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($handler, CURLOPT_POST, sizeof($postData));
curl_setopt($handler, CURLOPT_POSTFIELDS, $postData);
$response = curl_exec ($handler);
curl_close($handler);
When i run this code the result is "Resource id #2", the result i expect is this
{
"access_token": "2YotnFZFEjr1zCsicMWpAA",
"refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA",
"token_type": "bearer",
"expires_in": 3600
}
in console works fine, but when i try in PHP doesn't work,