Curl API not working

hi please help on how to get Deals using cURL.

if (!function_exists('curl_init')){
    die('Sorry cURL is not installed!');
	$api_token = 'token';

// Deal title and Organization ID

$Url = '' . $api_token;
//$Url = '';

// OK cool - then let's create a new cURL resource handle
$ch = curl_init();

// Now set some options (most are optional)
//$Url = '';
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $Url);

// Set a referer
curl_setopt($ch, CURLOPT_REFERER, "");

// User agent
curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");

// Include header in result? (0 = yes, 1 = no)
curl_setopt($ch, CURLOPT_HEADER, 0);

// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

// Download the given URL, and return output
$output = curl_exec($ch);

// Close the cURL resource, and free system resources
echo $Url;

there are 2 $Url variable for testing. i wonder why is there no output using API.

the snippet you posted actually works, but there is an apostrophe ` at the end that doesn’t belong there.
Does that help?

hi there! however did you tried using the Pipedrive url with API token instead? apostrophe should be remove but as long as it runs in your end.

when i tried checking on cURL error using

if (curl_error($ch)) {
$error_msg = curl_error($ch);

i got this message:
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version