- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
