cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PHP for Scanning API

SOLVED
Here to help

PHP for Scanning API

Can we use PHP for real-time/scanning API instead of Python, NodeJS etc.. Did any one tried this.? Any help or idea is really appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Kind of a big deal

Re: PHP for Scanning API

You can code a receiver in any language you want provided it behaves the way it's expected to behave. The language to totally irrelevant. 

 


@Skackar wrote:

You mean to say for MERAKI, we are just an API which will consume, right.?

 

In 1st Step: It sends the GET request to to validate the validator key using the url say: http://mydomain.com/scanner.php (GET)

 

In 2nd Step: It sends the POST request to the same url http://mydomain.com/scanner.php (POST) in specific time of interval with the real-time data of the connected user.

 

Am i correct in the above interpretation.? Please confirm.!

 

Thanks


Yup, that's basically right. The GET is sent periodically (like every 12 hours IIRC, and also when you click that "Validate" button). The POST happens once per minute for every AP in the network that has the Scanning API enabled. 

4 REPLIES 4
Kind of a big deal

Re: PHP for Scanning API

I don't see why not. The scanning API is very simple, it just sends JSON encoded data via HTTP POST to your application. What language that application is written in doesn't really matter. At the start there's also the validation procedure but that should also be easy to implement in PHP.

Here to help

Re: PHP for Scanning API

You mean to say for MERAKI, we are just an API which will consume, right.?

 

In 1st Step: It sends the GET request to to validate the validator key using the url say: http://mydomain.com/scanner.php (GET)

 

In 2nd Step: It sends the POST request to the same url http://mydomain.com/scanner.php (POST) in specific time of interval with the real-time data of the connected user.

 

Am i correct in the above interpretation.? Please confirm.!

 

Thanks

Kind of a big deal

Re: PHP for Scanning API

You can code a receiver in any language you want provided it behaves the way it's expected to behave. The language to totally irrelevant. 

 


@Skackar wrote:

You mean to say for MERAKI, we are just an API which will consume, right.?

 

In 1st Step: It sends the GET request to to validate the validator key using the url say: http://mydomain.com/scanner.php (GET)

 

In 2nd Step: It sends the POST request to the same url http://mydomain.com/scanner.php (POST) in specific time of interval with the real-time data of the connected user.

 

Am i correct in the above interpretation.? Please confirm.!

 

Thanks


Yup, that's basically right. The GET is sent periodically (like every 12 hours IIRC, and also when you click that "Validate" button). The POST happens once per minute for every AP in the network that has the Scanning API enabled. 

Highlighted
Here to help

Re: PHP for Scanning API

Thanks for your response. Tried it with PHP, but trying to Validate the URL from the dashboard its giving the below error:

 

Did not match validator: http://subdomain.mydomain.com/scanner.php

 

Am i doing something wrong.? Below is the PHP code i am using to validate it through GET request.

 

if(strcasecmp($_SERVER['REQUEST_METHOD'], 'GET') == 0) {

$q = new Queries();
    $data_array = array('status_text' => "Data returned with validator key: $validator", 'rtype' =>         $_SERVER['REQUEST_METHOD']);
$q->save_scan_data($data_array);
return $validator;

}

 

When clicking to validate from dashboard, get request coming to my server as scan log is saving at back-end.

 

Just have a look and let me know if you have any idea in it.

 

Thanks

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.