Can someone help me to understand how to do this API thing? The problem is, it doesn't display an output. Then, I have learned that the GET is not really needed(can be there or not) to be part of the code, but in this case, when I am deleting the GET I am getting an error output. This:
<a href="https://support.dudamobile.com/API/REST-Resources/Analytics">link</a>
is what I need to do...(please see the link)
So far, I have this code...
<?php
$data = '';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'GET https://api.dudamobile.com/api/analytics/site/{site_name}?from=2015-01-12&result=activities');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "{username}:{password}");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data))
);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
?>