I just want to ask... how can i convert this code:
$url='https://www.zopim.com/api/v2/agents';
$username="boom";
$password="baam";
// chat user
$ch1 = curl_init();
curl_setopt($ch1, CURLOPT_URL, $url);
curl_setopt($ch1, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch1, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
$output1 = curl_exec($ch1);
$info1 = curl_getinfo($ch1);
curl_close($ch1);
$userinfo = json_decode($output1);
to ajax... I want to call the json data automatically... hope you can help mo on this.. thanks..