cancel
Showing results for 
Search instead for 
Did you mean: 

Are the instructions on the aerohive developer site for setting up API connections the same for both cloud and on prem instances?

Are the instructions on the aerohive developer site for setting up API connections the same for both cloud and on prem instances?

brad_newton1
New Contributor

I am currently trying to setup API integration with our on prem instance and I am unable to get things working. Any suggestions?

1 ACCEPTED SOLUTION

david_allen
New Contributor

This took awhile to figure out but figure it may help someone else down the road. In order to gain access to the API for the on-prem version of HiveManager... This example is using the Postman app to do API requests

 

Go to Global Settings > API Token Management

  • Click the + sign to generate a new token
  • Enter a Client ID and hit generate. This example will use the client ID of LocalHVM

 

Fire up Postman and generate a new basic request. In this example we are doing a GET request.

The URL we're are going to send the request to is:

 

 

https://YOURLOCALVM.com/xapi/v1/monitor/devices?ownerId=2

 

The "?ownerID=2" section is very important and referrers to the local version of HiveManager, do not delete this!

 

THE REQUEST:

Under the "Authorization" tab - set this to "No Authorization"

Under the "Headers" tab is where you do most of the configuration:

  • Create a new key called "Authorization" with a value of "Bearer YourGeneratedAUTHORIZATIONToken"
    • Example of this field is: "Bearer -o4JBaLbd37728xxyR795V8W9ZJFLocalHVM"
  • Create a new key called "X-AH-API-CLIENT-ID" with a value of "YourClientID"
    • Example of this field is: "LocalHVM"
    • This is what the user entered earlier under API Token Management
  • Create a new key called "X-AH-API-CLIENT-SECRET" with a value of "YourGeneratedREFRESHToken"
    • Example of this field is: " VuUUVT1-uuREn3szUeOtfsXcIq9Gb8cV3"
  • Create a new key called "X-AH-API-CLIENT-REDIRECT-URI" with a value of "https://YOURLOCALVM.com"
    • Example of this field is: "https://YOURLOCALVM.com"

 

 

View solution in original post

3 REPLIES 3

aprice
New Contributor

Excellent answer. It took me a couple weekends a few months ago to figure all that out.

 

Postman also has a great Environments feature where you can create collections of different key-value pairs and then use those variables to pull the values into your header or content fields later. This makes updating your HiveManager API keys really quick. Just edit them once and all your saved calls get updated without displaying the value to onlookers. And, as the name implies, if you have different environments you can switch between them quickly to target your code at dev, test, prod, or whatever else you've got.

 

Being able to update the different header values was a big time saver when I was trying to sort out which ones to use and then the API calls I wanted to make.

david_allen
New Contributor

This took awhile to figure out but figure it may help someone else down the road. In order to gain access to the API for the on-prem version of HiveManager... This example is using the Postman app to do API requests

 

Go to Global Settings > API Token Management

  • Click the + sign to generate a new token
  • Enter a Client ID and hit generate. This example will use the client ID of LocalHVM

 

Fire up Postman and generate a new basic request. In this example we are doing a GET request.

The URL we're are going to send the request to is:

 

 

https://YOURLOCALVM.com/xapi/v1/monitor/devices?ownerId=2

 

The "?ownerID=2" section is very important and referrers to the local version of HiveManager, do not delete this!

 

THE REQUEST:

Under the "Authorization" tab - set this to "No Authorization"

Under the "Headers" tab is where you do most of the configuration:

  • Create a new key called "Authorization" with a value of "Bearer YourGeneratedAUTHORIZATIONToken"
    • Example of this field is: "Bearer -o4JBaLbd37728xxyR795V8W9ZJFLocalHVM"
  • Create a new key called "X-AH-API-CLIENT-ID" with a value of "YourClientID"
    • Example of this field is: "LocalHVM"
    • This is what the user entered earlier under API Token Management
  • Create a new key called "X-AH-API-CLIENT-SECRET" with a value of "YourGeneratedREFRESHToken"
    • Example of this field is: " VuUUVT1-uuREn3szUeOtfsXcIq9Gb8cV3"
  • Create a new key called "X-AH-API-CLIENT-REDIRECT-URI" with a value of "https://YOURLOCALVM.com"
    • Example of this field is: "https://YOURLOCALVM.com"

 

 

samantha_lynn
Esteemed Contributor III

The two are mostly similar with two major differences:

 

  • On-prem does not support location/presence APIs or webhook
  • When calling the other on-prem APIs, the ownerID parameter is always set to ‘2’

 

Also, the URLs to call the APIs are constructed slightly differently. The endpoints are found at https://<FQDN_of_the_onprem_VA>/ + endpoint. For example, the monitor/devices endpoint on the VA will be at:

https://<FQDN>/xapi/v1/monitor/devices.

 

GTM-P2G8KFN