I need help for monitoring AP's

  • 2
  • Question
  • Updated 1 year ago
  • (Edited)
Hello.
I would like to get help with some doubts about APIs and the AP monitoring.
First of all, I need to know how Token can be updated once it has expired before of three months. That's why, I can see a Refresh Token but not a call to update it. 

Secondly, I would like to know if there's anyway to know the TX and TR both of them the AP and connected users. Neither I can see any information about on the configuration of the different radio of the AP's nor its frequency, the channel and the tx_poxer.
Photo of Lluis Antoni

Lluis Antoni

  • 1 Post
  • 0 Reply Likes

Posted 1 year ago

  • 2
Photo of Jonas Dekkers

Jonas Dekkers

  • 152 Posts
  • 29 Reply Likes
I can help you with your first question. You need to post the following.
https://cloud.aerohive.com/services/oauth2/token?grant_type=refresh_token&redirect_uri=YOURURI&client_id=YOURCLIENTID&client_secret=YOURCLIENTSECRET&refresh_token=YOURREFRESHTOKEN

In php:
<?php

$request = new HttpRequest();
$request->setUrl('https://cloud.aerohive.com/services/oauth2/token');
$request->setMethod(HTTP_METH_POST);

$request->setQueryData(array(
  'grant_type' => 'refresh_token',
  'redirect_uri' => 'YOURURI',
  'client_id' => 'YOURCLIENTID',
  'client_secret' => 'YOURCLIENTSECRET',
  'refresh_token' => 'YOURREFRESHTOKEN'
));

$request->setHeaders(array(
  'postman-token' => '634cd1da-3df2-e631-4208-ddff9a826228',
  'cache-control' => 'no-cache',
  'content-type' => 'application/x-www-form-urlencoded',
  'refresh_token' => 'YOURREFRESHTOKEN',
  'client_secret' => 'YOURCLIENTSECRET',
  'client_id' => 'YOURCLIENTID',
  'redirect_uri' => 'http://www.complit.be',
  'grant_type' => 'refresh_token'
));

$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
  '' => ''
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}



IN C#
var client = new RestClient("https://cloud.aerohive.com/services/oauth2/token?grant_type=refresh_token&redirect_uri=YOURURI&a...;
var request = new RestRequest(Method.POST);
request.AddHeader("postman-token", "03b32df6-76ca-36f1-fbd0-1bd2cf3cc20b");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("refresh_token", "YOURREFRESHTOKEN");
request.AddHeader("client_secret", "YOURCLIENTSECRET");
request.AddHeader("client_id", "YOURCLIENTID");
request.AddHeader("redirect_uri", "http://www.complit.be");
request.AddHeader("grant_type", "refresh_token");
request.AddParameter("application/x-www-form-urlencoded", "=", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);


In java:
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "=");
Request request = new Request.Builder()
  .url("https://cloud.aerohive.com/services/oauth2/token?grant_type=refresh_token&redirect_uri=YOURURI&a...)
  .post(body)
  .addHeader("grant_type", "refresh_token")
  .addHeader("redirect_uri", "http://www.complit.be")
  .addHeader("client_id", "YOURCLIENTID")
  .addHeader("client_secret", "YOURCLIENTSECRET")
  .addHeader("refresh_token", "YOURREFRESHTOKEN")
  .addHeader("content-type", "application/x-www-form-urlencoded")
  .addHeader("cache-control", "no-cache")
  .addHeader("postman-token", "2cd1c49d-7976-40b1-3333-24d7a68b1f91")
  .build();

Response response = client.newCall(request).execute();