cancel
Showing results for 
Search instead for 
Did you mean: 

A "simple" total connected client-return via API to php/curl?

erik_sthl
New Contributor
So first out -> Im fairly new to connect to API via curl and php. I've been trying for Days to actually figure out how to just get the number of total connected wifi-clients to our Ruckus-network. I've been trying lots of stuff but with poor results. 

Here's what i've got atm: 

$curl2 = curl_init();
curl_setopt_array($curl2, array(
  CURLOPT_URL => "https://10.98.0.6:8443/wsg/api/public/v6_1/aps//operational/client/totalCount";,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_SSL_VERIFYPEER => 0,
  CURLOPT_SSL_VERIFYHOST => 0,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache"
  ),
));
$response2 = curl_exec($curl2);
$err2 = curl_error($curl2);
if ($err2) {
  echo "cURL Error #:" . $err2;
} else {
$response2 = json_decode(json_encode($response2), true);
  echo $response2;
}
curl_close($curl2);




So this code generates "{"message":"Current session has timed out.","errorCode":201,"errorType":"No active session"}". My guess is that I need to make a similar login-script and get some sort of session-cookie? And for this i'm lost. I've tried a couple of things but without any results. The code down below for logon returns, as far as I can see, nothing. 

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_PORT => "8443",
  CURLOPT_URL => "https://10.98.0.6:8443/wsg/api/public/v6_1/session";,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCO...






















0 REPLIES 0
Labels