<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic A &amp;quot;simple&amp;quot; total connected client-return via API to php/curl? in Access Points - Indoor and Outdoor</title>
    <link>https://community.ruckuswireless.com/t5/Access-Points-Indoor-and-Outdoor/A-quot-simple-quot-total-connected-client-return-via-API-to-php/m-p/13959#M3431</link>
    <description>So first out -&amp;gt; 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.&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Here's what i've got atm:&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$curl2 = curl_init();&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_setopt_array($curl2, array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_URL =&amp;gt; "&lt;A alt="" href="https://10.98.0.6:8443/wsg/api/public/v6_1/aps/&amp;lt;macadress cluster here of&amp;gt;/operational/client/totalCount\"&gt;&lt;/A&gt;&lt;A href="https://10.98.0.6:8443/wsg/api/public/v6_1/aps/" target="test_blank"&gt;https://10.98.0.6:8443/wsg/api/public/v6_1/aps/&lt;/A&gt;&lt;MACADRESS of="" cluster="" here=""&gt;/operational/client/totalCount";,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_RETURNTRANSFER =&amp;gt; true,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_TIMEOUT =&amp;gt; 30,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYPEER =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYHOST =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_CUSTOMREQUEST =&amp;gt; "GET",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_HTTPHEADER =&amp;gt; array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "cache-control: no-cache"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; ),&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;));&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$response2 = curl_exec($curl2);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$err2 = curl_error($curl2);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;if ($err2) {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; echo "cURL Error #:" . $err2;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;} else {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$response2 = json_decode(json_encode($response2), true);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; echo $response2;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;}&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_close($curl2);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;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.&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$curl = curl_init();&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_setopt_array($curl, array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_PORT =&amp;gt; "8443",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_URL =&amp;gt; "&lt;A href="https://10.98.0.6:8443/wsg/api/public/v6_1/session\"&gt;https://10.98.0.6:8443/wsg/api/public/v6_1/session";,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_RETURNTRANSFER =&amp;gt; true,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_ENCODING =&amp;gt; "",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_MAXREDIRS =&amp;gt; 10,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_TIMEOUT =&amp;gt; 30,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYPEER =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYHOST =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_CUSTOMREQUEST =&amp;gt; "POST",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_POSTFIELDS =&amp;gt; "{\r\n&amp;nbsp; \"username\": \"&lt;USERNAME&gt;\",\r\n&amp;nbsp; \"password\": \"&lt;PASSWORD&gt;\",\r\n&amp;nbsp; \"timeZoneUtcOffset\": \"+01:00\"\r\n}",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp; CURLOPT_HTTPHEADER =&amp;gt; array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "cache-control: no-cache",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "content-type: application/json;charset=UTF-8",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "cookie: JSESSIONID={JSESSIONID}",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; ),&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;));&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$response = curl_exec($curl);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$err = curl_error($curl);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_close($curl);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is there some Beautiful human being that can help me with this. This isnt my main area of expertise, I simply just want to show total amount of clients connected to our wifi in a dashboard.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;/PASSWORD&gt;&lt;/USERNAME&gt;&lt;/A&gt;&lt;/MACADRESS&gt;</description>
    <pubDate>Wed, 10 Apr 2019 09:02:01 GMT</pubDate>
    <dc:creator>erik_sthl</dc:creator>
    <dc:date>2019-04-10T09:02:01Z</dc:date>
    <item>
      <title>A "simple" total connected client-return via API to php/curl?</title>
      <link>https://community.ruckuswireless.com/t5/Access-Points-Indoor-and-Outdoor/A-quot-simple-quot-total-connected-client-return-via-API-to-php/m-p/13959#M3431</link>
      <description>So first out -&amp;gt; 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.&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;Here's what i've got atm:&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$curl2 = curl_init();&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_setopt_array($curl2, array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_URL =&amp;gt; "&lt;A alt="" href="https://10.98.0.6:8443/wsg/api/public/v6_1/aps/&amp;lt;macadress cluster here of&amp;gt;/operational/client/totalCount\"&gt;&lt;/A&gt;&lt;A href="https://10.98.0.6:8443/wsg/api/public/v6_1/aps/" target="test_blank"&gt;https://10.98.0.6:8443/wsg/api/public/v6_1/aps/&lt;/A&gt;&lt;MACADRESS of="" cluster="" here=""&gt;/operational/client/totalCount";,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_RETURNTRANSFER =&amp;gt; true,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_TIMEOUT =&amp;gt; 30,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYPEER =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYHOST =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_CUSTOMREQUEST =&amp;gt; "GET",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_HTTPHEADER =&amp;gt; array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "cache-control: no-cache"&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; ),&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;));&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$response2 = curl_exec($curl2);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$err2 = curl_error($curl2);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;if ($err2) {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; echo "cURL Error #:" . $err2;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;} else {&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$response2 = json_decode(json_encode($response2), true);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; echo $response2;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;}&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_close($curl2);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;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.&amp;nbsp;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$curl = curl_init();&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_setopt_array($curl, array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_PORT =&amp;gt; "8443",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_URL =&amp;gt; "&lt;A href="https://10.98.0.6:8443/wsg/api/public/v6_1/session\"&gt;https://10.98.0.6:8443/wsg/api/public/v6_1/session";,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_RETURNTRANSFER =&amp;gt; true,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_ENCODING =&amp;gt; "",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_MAXREDIRS =&amp;gt; 10,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_TIMEOUT =&amp;gt; 30,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYPEER =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_SSL_VERIFYHOST =&amp;gt; 0,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_CUSTOMREQUEST =&amp;gt; "POST",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; CURLOPT_POSTFIELDS =&amp;gt; "{\r\n&amp;nbsp; \"username\": \"&lt;USERNAME&gt;\",\r\n&amp;nbsp; \"password\": \"&lt;PASSWORD&gt;\",\r\n&amp;nbsp; \"timeZoneUtcOffset\": \"+01:00\"\r\n}",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp; CURLOPT_HTTPHEADER =&amp;gt; array(&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "cache-control: no-cache",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "content-type: application/json;charset=UTF-8",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "cookie: JSESSIONID={JSESSIONID}",&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&amp;nbsp; ),&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;));&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$response = curl_exec($curl);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;$err = curl_error($curl);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;curl_close($curl);&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Is there some Beautiful human being that can help me with this. This isnt my main area of expertise, I simply just want to show total amount of clients connected to our wifi in a dashboard.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR alt="" name="" rel="" target="" title="" type="" value="" /&gt;&lt;/PASSWORD&gt;&lt;/USERNAME&gt;&lt;/A&gt;&lt;/MACADRESS&gt;</description>
      <pubDate>Wed, 10 Apr 2019 09:02:01 GMT</pubDate>
      <guid>https://community.ruckuswireless.com/t5/Access-Points-Indoor-and-Outdoor/A-quot-simple-quot-total-connected-client-return-via-API-to-php/m-p/13959#M3431</guid>
      <dc:creator>erik_sthl</dc:creator>
      <dc:date>2019-04-10T09:02:01Z</dc:date>
    </item>
  </channel>
</rss>

